From d3851621de4efd74e34777aca8626a146c03d4b1 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 30 Jan 2017 14:06:58 -0800 Subject: remove caching until we prove it is required --- activerecord/lib/active_record/reflection.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'activerecord/lib') 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? -- cgit v1.2.3