Displaying 1 result from an estimated 1 matches for "attr_accessiblefor".
2012 Jul 09
10
attr_accessible on some properties + attr_protected on others makes class 'open-by-default'
...dded later, they will be accessible by
default to MassAssignment.
This undoes the entire point of having put attr_accessible in one''s class.
Two possible solutions -
#1) ''default-closed'' - the attr_protected statements will either be
ignored, or just used to override attr_accessiblefor a particular property.
#2) ''explicit-only'' - any attribute accessed in mass-assignment that is not
explicitly mentioned in eitherattr_accessible or attr_protected raises a
new error - something like
MassAssignmentError:AttributeNotExplicitlyDeclared. Maybe even throw an
error...