Remove ActiveRecord::AttributeAssignment#assign_nested_parameter_attributes
#49678
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation / Background
The private
#assign_nested_parameter_attributes
was introduced in 774ff18 (Dec 15, 2011), moved toActiveRecord::AttributeAssignment
in ceb33f8 (also Dec 15, 2011), then most recently modified in 2606fb3 (Jan 23, 2015) whenActiveModel::AttributeAssignment
was extracted.Support for
accepts_nested_attributes_for
(introduced in ec8f045 Feb 1, 2009) pre-dates those commits, and has evolved enough to cover this behavior in other ways.Detail
With its removal, Active Record's test suite still passes, so if it's a crucial piece of code to retain, we should expand the suite to exercise it.
Additional information
The fact that removing these methods doesn't fail the test suite came out of #49675. If that PR isn't deemed to be viable, removing the code in this PR might still have value. If that PR is deemed to be viable, we might want to merge this PR ahead of it, then make similar changes to remove the calls from https://github.com/rails/rails/pull/49675/files#diff-bd47ea9eef412ec5aca24908af217592cef01d24fd54eeec976bd37bd9a18151R80.