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:
parent
0587a7f684
commit
596c16f1db
|
@ -15,7 +15,7 @@ module SimpleForm
|
||||||
def readonly_attribute?
|
def readonly_attribute?
|
||||||
object.class.respond_to?(:readonly_attributes) &&
|
object.class.respond_to?(:readonly_attributes) &&
|
||||||
object.persisted? &&
|
object.persisted? &&
|
||||||
object.class.readonly_attributes.include?(attribute_name)
|
object.class.readonly_attributes.include?(attribute_name.to_s)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -130,7 +130,7 @@ class User
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.readonly_attributes
|
def self.readonly_attributes
|
||||||
[:credit_card]
|
["credit_card"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue