Permalink
Browse files

explains why the query cache checks arel.locked

  • Loading branch information...
1 parent 5f5a43e commit 249f58b7ec0ab96893c01340881534ba3b46ced6 @fxn fxn committed Jan 28, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
View
2 activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
@@ -85,6 +85,8 @@ def cache_sql(sql, binds)
end
end
+ # If arel is locked this is a SELECT ... FOR UPDATE or somesuch. Such
+ # queries should not be cached.
def locked?(arel)
arel.respond_to?(:locked) && arel.locked
end

0 comments on commit 249f58b

Please sign in to comment.