Skip to content

Commit 75ba520

Browse files
authored
Merge pull request rails#49678 from seanpdoyle/remove-unnecessary-method-from-attribute-assignment
Remove `ActiveRecord::AttributeAssignment#assign_nested_parameter_attributes`
2 parents 9dab3e4 + ded026b commit 75ba520

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

activerecord/lib/active_record/attribute_assignment.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,21 @@ module ActiveRecord
44
module AttributeAssignment
55
private
66
def _assign_attributes(attributes)
7-
multi_parameter_attributes = nested_parameter_attributes = nil
7+
multi_parameter_attributes = nil
88

99
attributes.each do |k, v|
1010
key = k.to_s
1111

1212
if key.include?("(")
1313
(multi_parameter_attributes ||= {})[key] = v
14-
elsif v.is_a?(Hash)
15-
(nested_parameter_attributes ||= {})[key] = v
1614
else
1715
_assign_attribute(key, v)
1816
end
1917
end
2018

21-
assign_nested_parameter_attributes(nested_parameter_attributes) if nested_parameter_attributes
2219
assign_multiparameter_attributes(multi_parameter_attributes) if multi_parameter_attributes
2320
end
2421

25-
# Assign any deferred nested attributes after the base attributes have been set.
26-
def assign_nested_parameter_attributes(pairs)
27-
pairs.each { |k, v| _assign_attribute(k, v) }
28-
end
29-
3022
# Instantiates objects for all attribute classes that needs more than one constructor parameter. This is done
3123
# by calling new on the column type or aggregation type (through composed_of) object with these parameters.
3224
# So having the pairs written_on(1) = "2004", written_on(2) = "6", written_on(3) = "24", will instantiate

0 commit comments

Comments
 (0)