diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2017-03-09 11:23:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-09 11:23:32 -0500 |
commit | c77cbaff49218db7e5fe93cffc2f5333e63a99c9 (patch) | |
tree | 332a8c412548fa94594cc6e55384e86b8cc31f07 /activerecord/lib/active_record/associations | |
parent | 17c65342469f211f4a845073e47bf1dfa13ba259 (diff) | |
parent | ef3d6fc1d304dbfed7e49fdf501818891839ef65 (diff) | |
download | rails-c77cbaff49218db7e5fe93cffc2f5333e63a99c9.tar.gz rails-c77cbaff49218db7e5fe93cffc2f5333e63a99c9.tar.bz2 rails-c77cbaff49218db7e5fe93cffc2f5333e63a99c9.zip |
Merge pull request #28354 from kamipo/fix_select_with_block_and_dirty_target
Fix select with block doesn't return newly built records in has_many association
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/collection_proxy.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/collection_proxy.rb b/activerecord/lib/active_record/associations/collection_proxy.rb index 55bf2e0ff0..bc2f359c65 100644 --- a/activerecord/lib/active_record/associations/collection_proxy.rb +++ b/activerecord/lib/active_record/associations/collection_proxy.rb @@ -78,7 +78,7 @@ module ActiveRecord # # #<Pet id: nil, name: "Choo-Choo"> # # ] # - # person.pets.select(:id, :name ) + # person.pets.select(:id, :name) # # => [ # # #<Pet id: 1, name: "Fancy-Fancy">, # # #<Pet id: 2, name: "Spook">, @@ -1121,7 +1121,7 @@ module ActiveRecord SpawnMethods, ].flat_map { |klass| klass.public_instance_methods(false) - } - self.public_instance_methods(false) + [:scoping] + } - self.public_instance_methods(false) - [:select] + [:scoping] delegate(*delegate_methods, to: :scope) |