1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Revert "Work around count returning string (bug)"

This reverts commit 4bb6f77059.
This commit is contained in:
Emilio Tagua 2009-05-02 12:59:49 -03:00
parent 3fd467e9ed
commit d522b7ccf6

View file

@ -690,7 +690,7 @@ module ActiveRecord #:nodoc:
def exists?(id_or_conditions = {}) def exists?(id_or_conditions = {})
construct_finder_arel({ construct_finder_arel({
:conditions =>expand_id_conditions(id_or_conditions) :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 end
# Creates an object (or multiple objects) and saves it to the database, if validations pass. # Creates an object (or multiple objects) and saves it to the database, if validations pass.