diff --git a/lib/simple_form/components/readonly.rb b/lib/simple_form/components/readonly.rb index 504072e1..f4a986c2 100644 --- a/lib/simple_form/components/readonly.rb +++ b/lib/simple_form/components/readonly.rb @@ -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 diff --git a/test/support/models.rb b/test/support/models.rb index bb5727fe..6e1bd9d6 100644 --- a/test/support/models.rb +++ b/test/support/models.rb @@ -130,7 +130,7 @@ class User end def self.readonly_attributes - [:credit_card] + ["credit_card"] end end