rubocop / rails-style-guide

A community-driven Ruby on Rails style guide
http://rails.rubystyle.guide
6.47k stars 1.06k forks source link

Add the update_only option to accepts_nested_attributes_for attributes writers #346

Open olivier-thatch opened 10 months ago

olivier-thatch commented 10 months ago

Goes with https://github.com/rubocop/rubocop-rails/pull/1035.

When using accepts_nested_attributes_for, it is preferable to make an explicit decision regarding how nested attributes are going to be used when an associated record already exists.