fixed readonly attribute check, uses now string

ActiveRecord.readonly_attributes returns a set of strings, not a set of
symbols. Verified with Rails 2.3 and 3.2.
This commit is contained in:
Reto Schüttel 2012-06-21 15:29:28 +02:00
parent 0587a7f684
commit 596c16f1db
2 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,7 @@ module SimpleForm
def readonly_attribute?
object.class.respond_to?(:readonly_attributes) &&
object.persisted? &&
object.class.readonly_attributes.include?(attribute_name)
object.class.readonly_attributes.include?(attribute_name.to_s)
end
end
end

View File

@ -130,7 +130,7 @@ class User
end
def self.readonly_attributes
[:credit_card]
["credit_card"]
end
end