Rails: how do attributes become protected (without any attr_protected or attr_accessible call)?

I get "WARNING: I cannot assign protected attributes: type", but I have no calls to attr_accessible or attr_protected in my code.

Is there anything else that might cause the attribute to be protected?

I don’t really like to add all the attributes to the attr_accessible , because this is becoming one more thing to support.

+4
source share
2 answers

The type attribute is reserved for internal use to inherit from a single table.

You can use type by setting set_inheritance_column

 set_inheritance_column :kind # change to something other than :type. 
+5
source

Check out: Rails attr_accessible doesn't work for: type?

:type is your problem.

0
source

All Articles