search for: attributenotexplicitlydeclared

Displaying 1 result from an estimated 1 matches for "attributenotexplicitlydeclared".

2012 Jul 09
10
attr_accessible on some properties + attr_protected on others makes class 'open-by-default'
...er 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 if the attribute is accessed in*any* way (mything.whatever="boo"; # kerplow! throws error?) though that might perform poorly. Solution #1 is probably fine - accesses to not attr_accessible properties will throw a MassAssignment error under these circumstance...