Only use versions.
This commit is contained in:
@@ -14,19 +14,15 @@ module Precious
|
|||||||
end
|
end
|
||||||
|
|
||||||
def author
|
def author
|
||||||
pagev = @page.version
|
|
||||||
return DEFAULT_AUTHOR unless pagev
|
|
||||||
first = @page.versions.first
|
first = @page.versions.first
|
||||||
author = first == nil ? pagev.author : first.author
|
return DEFAULT_AUTHOR unless first
|
||||||
author.name
|
first.author.name
|
||||||
end
|
end
|
||||||
|
|
||||||
def date
|
def date
|
||||||
pagev = @page.version
|
|
||||||
return Time.now.strftime(DATE_FORMAT) unless pagev
|
|
||||||
first = @page.versions.first
|
first = @page.versions.first
|
||||||
date = first == nil ? pagev.authored_date : first.authored_date
|
return Time.now.strftime(DATE_FORMAT) unless first
|
||||||
date.strftime(DATE_FORMAT)
|
first.authored_date.strftime(DATE_FORMAT)
|
||||||
end
|
end
|
||||||
|
|
||||||
def editable
|
def editable
|
||||||
|
|||||||
Reference in New Issue
Block a user