From 951aa8da2f484cb4324b3501481ce178948bcd43 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Thu, 15 Jun 2017 18:27:00 +0900 Subject: Ensure query caching for `select_*` methods in connection adapters --- activerecord/lib/active_record/relation/finder_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/relation') diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 0a339f8756..1d661fa8ed 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -316,7 +316,7 @@ module ActiveRecord relation = construct_relation_for_exists(relation, conditions) - connection.select_one(relation.arel, "#{name} Exists", relation.bound_attributes) ? true : false + connection.select_value(relation, "#{name} Exists", relation.bound_attributes) ? true : false rescue ::RangeError false end -- cgit v1.2.3