When using mass assignment security (attr_accessible, attr_protected) and 
accepts_nested_attributes_for, and when passing in the associated models in 
a request, an _attributes suffix must be added to the key/name of the 
attribute, even though accepts_nested_attributes_for does not require the 
_attributes suffix on the association's name.

In the spirit of DRY, it seems like if an association has been declared, 
the model should know that some_association_name is an association without 
having to add the _attributes suffix in attr_accessible and in JSON 
requests. Could Rails 4 do away with the need for the _attributes suffix in 
mass assignment security when referring to some_association_name that has 
accepts_nested_attributes_for? It seems awfully repetitive to have to 
specify that over and over for little reason. If anything, it seems like 
some new class methods specific to associations for mass assignment 
security would make more sense if it is having to look for an _attributes 
suffix.

Thanks,
Gary

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-core/-/UppoVeoOtLoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to