From 425f2cacafc522bb0aa426a0a4bc92c1237160aa Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 29 Jun 2017 02:11:28 +0900 Subject: Remove delegating to arel in a relation The delegation was needed since passing `relation` with `relation.bound_attributes`. It should use `relation.arel` in that case. --- .../lib/active_record/connection_adapters/abstract/query_cache.rb | 1 + 1 file changed, 1 insertion(+) (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 e53ba4e666..33695c0537 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb @@ -123,6 +123,7 @@ module ActiveRecord # If arel is locked this is a SELECT ... FOR UPDATE or somesuch. Such # queries should not be cached. def locked?(arel) + arel = arel.arel if arel.is_a?(Relation) arel.respond_to?(:locked) && arel.locked end -- cgit v1.2.3