From d522b7ccf61a71b4c66ddf39368513d1fd9cd577 Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Sat, 2 May 2009 12:59:49 -0300 Subject: [PATCH] Revert "Work around count returning string (bug)" This reverts commit 4bb6f77059a34ea7c8575523397032b4cc67e00a. --- activerecord/lib/active_record/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index b1ae2fbe78..3b693b5f17 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -690,7 +690,7 @@ module ActiveRecord #:nodoc: def exists?(id_or_conditions = {}) construct_finder_arel({ :conditions =>expand_id_conditions(id_or_conditions) - }).project(arel_table[primary_key]).take(1).count.to_i > 0 + }).project(arel_table[primary_key]).take(1).count > 0 end # Creates an object (or multiple objects) and saves it to the database, if validations pass.