Permalink
Browse files

Work around count returning string (bug)

  • Loading branch information...
1 parent 59b58df commit 4bb6f77059a34ea7c8575523397032b4cc67e00a @jeremy jeremy committed May 1, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/base.rb
@@ -690,7 +690,7 @@ def find_by_sql(sql)
def exists?(id_or_conditions = {})
construct_finder_arel({
:conditions =>expand_id_conditions(id_or_conditions)
- }).project(arel_table[primary_key]).take(1).count > 0
+ }).project(arel_table[primary_key]).take(1).count.to_i > 0
end
# Creates an object (or multiple objects) and saves it to the database, if validations pass.

0 comments on commit 4bb6f77

Please sign in to comment.