From e8be3a9016b6c27ead6d5608c3f988c5f72b385b Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 30 Jan 2017 13:51:48 -0800 Subject: Fix `scopes` implementation on `PolymorphicReflection` `PolymorphicReflection` needs to be custom for handling scope lambdas --- activerecord/lib/active_record/associations/join_dependency.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/associations/join_dependency.rb') diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index a79eb03acc..87e0847ec1 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -171,7 +171,7 @@ module ActiveRecord chain = child.reflection.chain foreign_table = parent.table foreign_klass = parent.base_klass - child.join_constraints(foreign_table, foreign_klass, child, join_type, tables, child.reflection.scope_chain, chain) + child.join_constraints(foreign_table, foreign_klass, child, join_type, tables, chain) end def make_outer_joins(parent, child) -- cgit v1.2.3