rubocop / rails-style-guide

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

Add the update_only option to accepts_nested_attributes_for attributes writers #346

Open olivier-thatch opened 1 year ago

olivier-thatch commented 1 year 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.