From 1cd40d48ba73f0d8a5d5de8974ca424776c26d64 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 14 Apr 2014 17:14:19 -0700 Subject: oops. should probably double check in the DCL --- activerecord/lib/active_record/reflection.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/reflection.rb b/activerecord/lib/active_record/reflection.rb index 3123839a10..32315c4994 100644 --- a/activerecord/lib/active_record/reflection.rb +++ b/activerecord/lib/active_record/reflection.rb @@ -207,7 +207,9 @@ module ActiveRecord def association_scope_cache(conn) key = conn.prepared_statements - @association_scope_cache[key] ||= @scope_lock.synchronize { yield } + @association_scope_cache[key] ||= @scope_lock.synchronize { + @association_scope_cache[key] ||= yield + } end # Returns a new, unsaved instance of the associated class. +attributes+ will -- cgit v1.2.3