Avoid nil.

This commit is contained in:
bootstraponline
2012-05-23 00:04:57 -06:00
parent e160822b0f
commit f765137f3f
+2 -2
View File
@@ -14,13 +14,13 @@ module Precious
end
def author
first = @page.versions.first
first = @page.versions ? @page.versions.first : false
return DEFAULT_AUTHOR unless first
first.author.name
end
def date
first = @page.versions.first
first = @page.versions ? @page.versions.first : false
return Time.now.strftime(DATE_FORMAT) unless first
first.authored_date.strftime(DATE_FORMAT)
end