search for: eitherattr_accessible

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

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