diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-14 17:14:19 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-14 17:14:19 -0700 |
commit | 1cd40d48ba73f0d8a5d5de8974ca424776c26d64 (patch) | |
tree | 37fbec9a015123d9aaf5714603bede5d10ce27b7 | |
parent | bd3b28f7f181dce53e872daa23dda101498b8fb4 (diff) | |
download | rails-1cd40d48ba73f0d8a5d5de8974ca424776c26d64.tar.gz rails-1cd40d48ba73f0d8a5d5de8974ca424776c26d64.tar.bz2 rails-1cd40d48ba73f0d8a5d5de8974ca424776c26d64.zip |
oops. should probably double check in the DCL
-rw-r--r-- | activerecord/lib/active_record/reflection.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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 |