Skip to content
Browse files

oops. should probably double check in the DCL

  • Loading branch information...
1 parent bd3b28f commit 1cd40d48ba73f0d8a5d5de8974ca424776c26d64 @tenderlove tenderlove committed Apr 14, 2014
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/reflection.rb
View
4 activerecord/lib/active_record/reflection.rb
@@ -207,7 +207,9 @@ def initialize(macro, name, scope, options, active_record)
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

0 comments on commit 1cd40d4

Please sign in to comment.
Something went wrong with that request. Please try again.