Only use versions.

This commit is contained in:
bootstraponline
2012-05-22 23:48:56 -06:00
parent c0e35b0126
commit e160822b0f
+4 -8
View File
@@ -14,19 +14,15 @@ module Precious
end
def author
pagev = @page.version
return DEFAULT_AUTHOR unless pagev
first = @page.versions.first
author = first == nil ? pagev.author : first.author
author.name
return DEFAULT_AUTHOR unless first
first.author.name
end
def date
pagev = @page.version
return Time.now.strftime(DATE_FORMAT) unless pagev
first = @page.versions.first
date = first == nil ? pagev.authored_date : first.authored_date
date.strftime(DATE_FORMAT)
return Time.now.strftime(DATE_FORMAT) unless first
first.authored_date.strftime(DATE_FORMAT)
end
def editable