From 249f58b7ec0ab96893c01340881534ba3b46ced6 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 28 Jan 2013 18:14:33 +0100 Subject: explains why the query cache checks arel.locked --- .../lib/active_record/connection_adapters/abstract/query_cache.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb') diff --git a/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb b/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb index be6fda95b4..095e027f94 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb @@ -85,6 +85,8 @@ module ActiveRecord 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 -- cgit v1.2.3