aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2017-07-16 21:04:12 +0200
committerGitHub <noreply@github.com>2017-07-16 21:04:12 +0200
commit720cf7fccc46f8f79a2d9ba3403f181074fb2072 (patch)
tree95813c2ccc34f3bacfb87600c55f6ea038aa2dab /activerecord/lib
parent919b55d9747f69c566616d740616d11ef2db8c58 (diff)
parent57e9495e64f6ff6e59bc7e25ee05df43aac472e1 (diff)
downloadrails-720cf7fccc46f8f79a2d9ba3403f181074fb2072.tar.gz
rails-720cf7fccc46f8f79a2d9ba3403f181074fb2072.tar.bz2
rails-720cf7fccc46f8f79a2d9ba3403f181074fb2072.zip
Merge pull request #29813 from kamipo/fix_create_with_multiparameter_attributes
Fix `create_with` with multiparameter attributes
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/scoping.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/scoping.rb b/activerecord/lib/active_record/scoping.rb
index 94e0ef6724..82e20a32d0 100644
--- a/activerecord/lib/active_record/scoping.rb
+++ b/activerecord/lib/active_record/scoping.rb
@@ -33,9 +33,8 @@ module ActiveRecord
def populate_with_current_scope_attributes # :nodoc:
return unless self.class.scope_attributes?
- self.class.scope_attributes.each do |att, value|
- send("#{att}=", value) if respond_to?("#{att}=")
- end
+ attributes = self.class.scope_attributes
+ _assign_attributes(attributes) if attributes.any?
end
def initialize_internals_callback # :nodoc: