diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attribute_assignment.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/attribute_assignment.rb b/activerecord/lib/active_record/attribute_assignment.rb index e368fdfff9..fdc90df5b6 100644 --- a/activerecord/lib/active_record/attribute_assignment.rb +++ b/activerecord/lib/active_record/attribute_assignment.rb @@ -5,6 +5,13 @@ module ActiveRecord extend ActiveSupport::Concern include ActiveModel::AttributeAssignment + # Alias for `assign_attributes`. See +ActiveModel::AttributeAssignment+. + def attributes=(attributes) + assign_attributes(attributes) + end + + private + def _assign_attributes(attributes) # :nodoc: multi_parameter_attributes = {} nested_parameter_attributes = {} @@ -22,13 +29,6 @@ module ActiveRecord assign_multiparameter_attributes(multi_parameter_attributes) unless multi_parameter_attributes.empty? end - # Alias for `assign_attributes`. See +ActiveModel::AttributeAssignment+ - def attributes=(attributes) - assign_attributes(attributes) - end - - private - # Assign any deferred nested attributes after the base attributes have been set. def assign_nested_parameter_attributes(pairs) pairs.each { |k, v| _assign_attribute(k, v) } |