aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/reflection.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index d923050822..81ec4924b0 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -807,9 +807,7 @@ module ActiveRecord
end
def source_type_scope
- type = foreign_type
- source_type = options[:source_type]
- lambda { |object| where(type => source_type) }
+ through_reflection.klass.where(foreign_type => options[:source_type])
end
def has_scope?