Permalink
Browse files

`where` automatically uses bind values now

  • Loading branch information...
1 parent 66e0321 commit d99974b27cac1d3ed3af6bef0b7551044a8c9923 @tenderlove tenderlove committed Mar 13, 2014
Showing with 2 additions and 5 deletions.
  1. +2 −5 activerecord/lib/active_record/relation/finder_methods.rb
@@ -292,11 +292,8 @@ def exists?(conditions = :none)
when Array, Hash
relation = relation.where(conditions)
else
- if conditions != :none
- column = columns_hash[primary_key]
- substitute = connection.substitute_at(column, bind_values.length)
- relation = where(table[primary_key].eq(substitute))
- relation.bind_values += [[column, conditions]]
+ unless conditions == :none
+ relation = where(primary_key => conditions)
end
end

0 comments on commit d99974b

Please sign in to comment.