diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-07-16 21:06:51 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-07-16 21:06:51 +0900 |
commit | 57e9495e64f6ff6e59bc7e25ee05df43aac472e1 (patch) | |
tree | aa897147511ec234c6bbe38fe87a95d3eb211264 /activerecord/lib | |
parent | 16f2b2044eaaa54b7bc205ef9af1689a152b2fdf (diff) | |
download | rails-57e9495e64f6ff6e59bc7e25ee05df43aac472e1.tar.gz rails-57e9495e64f6ff6e59bc7e25ee05df43aac472e1.tar.bz2 rails-57e9495e64f6ff6e59bc7e25ee05df43aac472e1.zip |
Fix `create_with` with multiparameter attributes
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/scoping.rb | 5 |
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: |