aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/reflection.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/reflection.rb')
-rw-r--r--activerecord/lib/active_record/reflection.rb10
1 files changed, 3 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb
index 70e2487891..cb240229a5 100644
--- a/activerecord/lib/active_record/reflection.rb
+++ b/activerecord/lib/active_record/reflection.rb
@@ -826,13 +826,9 @@ module ActiveRecord
end
def source_type_scope
- @source_type_lambda ||= begin
- type = foreign_type
- source_type = options[:source_type]
- lambda { |object|
- where(type => source_type)
- }
- end
+ type = foreign_type
+ source_type = options[:source_type]
+ lambda { |object| where(type => source_type) }
end
def has_scope?