Fix for 1.8 versions of ruby
This commit is contained in:
@@ -15,8 +15,8 @@ module Precious
|
|||||||
:id7 => v.id[0..6],
|
:id7 => v.id[0..6],
|
||||||
:num => i,
|
:num => i,
|
||||||
:selected => @page.version.id == v.id,
|
:selected => @page.version.id == v.id,
|
||||||
:author => v.author.name.force_encoding('UTF-8'),
|
:author => v.author.name.respond_to?(:force_encoding) ? v.author.name.force_encoding('UTF-8') : v.author.name,
|
||||||
:message => v.message.force_encoding('UTF-8'),
|
:message => v.message.respond_to?(:force_encoding) ? v.message.force_encoding('UTF-8') : v.message,
|
||||||
:date => v.committed_date.strftime("%B %d, %Y"),
|
:date => v.committed_date.strftime("%B %d, %Y"),
|
||||||
:gravatar => Digest::MD5.hexdigest(v.author.email) }
|
:gravatar => Digest::MD5.hexdigest(v.author.email) }
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module Precious
|
|||||||
page_versions = @page.versions
|
page_versions = @page.versions
|
||||||
first = page_versions ? page_versions.first : false
|
first = page_versions ? page_versions.first : false
|
||||||
return DEFAULT_AUTHOR unless first
|
return DEFAULT_AUTHOR unless first
|
||||||
first.author.name.force_encoding('UTF-8')
|
first.author.name.respond_to?(:force_encoding) ? first.author.name.force_encoding('UTF-8') : first.author.name
|
||||||
end
|
end
|
||||||
|
|
||||||
def date
|
def date
|
||||||
|
|||||||
Reference in New Issue
Block a user