aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2012-08-17 18:20:12 +0100
committerJon Leighton <j@jonathanleighton.com>2012-08-17 18:22:29 +0100
commit5ecb02f6dd60a742d93d306b70be09d6ffb29081 (patch)
treeb80105972d2a65828b6d18f683f4e88c88ec347e /activerecord/lib
parent49cb4ed845e730f69fb2a26a594976039d3d2559 (diff)
downloadrails-5ecb02f6dd60a742d93d306b70be09d6ffb29081.tar.gz
rails-5ecb02f6dd60a742d93d306b70be09d6ffb29081.tar.bz2
rails-5ecb02f6dd60a742d93d306b70be09d6ffb29081.zip
don't call method unless we need to
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/attribute_assignment.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_assignment.rb b/activerecord/lib/active_record/attribute_assignment.rb
index 6f6fc13d16..a54c103476 100644
--- a/activerecord/lib/active_record/attribute_assignment.rb
+++ b/activerecord/lib/active_record/attribute_assignment.rb
@@ -106,7 +106,7 @@ module ActiveRecord
# assign any deferred nested attributes after the base attributes have been set
nested_parameter_attributes.each { |k,v| _assign_attribute(k, v) }
- assign_multiparameter_attributes(multi_parameter_attributes)
+ assign_multiparameter_attributes(multi_parameter_attributes) unless multi_parameter_attributes.empty?
ensure
@mass_assignment_options = previous_options
end