Skip to content

Commit

Permalink
Remove 'needless boolean casting'.
Browse files Browse the repository at this point in the history
"Predicates in Rails rely on standard Ruby semantics for boolean values
and guarantee no singletons whatsoever." - @fxn
  • Loading branch information
chendo committed Mar 26, 2012
1 parent 8954ee6 commit ef64c6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/finder_methods.rb
Expand Up @@ -200,7 +200,7 @@ def exists?(id = false)
relation = relation.where(table[primary_key].eq(id)) if id
end

connection.select_value(relation, "#{name} Exists", relation.bind_values) ? true : false
connection.select_value(relation, "#{name} Exists", relation.bind_values)
end

protected
Expand Down

0 comments on commit ef64c6b

Please sign in to comment.