diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-27 21:00:06 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-27 21:00:06 -0700 |
commit | c81e4e6a2657f3f67b99a2f88e2909c36c9f3863 (patch) | |
tree | 7a1ed3017b80639d6266056577d3ca1d6fc77711 /activerecord/lib/active_record/associations | |
parent | dd3ea17191e316aeebddaa7b176f6cfeee7a6365 (diff) | |
parent | 70a5e5638bfd3b2543bb9d4805cbefec84b6b1ce (diff) | |
download | rails-c81e4e6a2657f3f67b99a2f88e2909c36c9f3863.tar.gz rails-c81e4e6a2657f3f67b99a2f88e2909c36c9f3863.tar.bz2 rails-c81e4e6a2657f3f67b99a2f88e2909c36c9f3863.zip |
Merge pull request #14154 from al2o3cr/issue12770
Pass a base relation to build_default_scope when joining
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_association.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/join_dependency/join_association.rb index cee3c9999f..1d923ecc09 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -54,7 +54,7 @@ module ActiveRecord end scope_chain_index += 1 - scope_chain_items.concat [klass.send(:build_default_scope)].compact + scope_chain_items.concat [klass.send(:build_default_scope, ActiveRecord::Relation.create(klass, table))].compact rel = scope_chain_items.inject(scope_chain_items.shift) do |left, right| left.merge right |