diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-13 11:21:54 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-03-13 11:21:54 -0700 |
commit | d99974b27cac1d3ed3af6bef0b7551044a8c9923 (patch) | |
tree | 2739c2a427eaa6febe0c7fcbf7a6d5ccb0f8d5a8 | |
parent | 66e032117fa5c6953a7b1d791dcdc1ee029e4cef (diff) | |
download | rails-d99974b27cac1d3ed3af6bef0b7551044a8c9923.tar.gz rails-d99974b27cac1d3ed3af6bef0b7551044a8c9923.tar.bz2 rails-d99974b27cac1d3ed3af6bef0b7551044a8c9923.zip |
`where` automatically uses bind values now
-rw-r--r-- | activerecord/lib/active_record/relation/finder_methods.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb index 61b129a71e..5ebfc318aa 100644 --- a/activerecord/lib/active_record/relation/finder_methods.rb +++ b/activerecord/lib/active_record/relation/finder_methods.rb @@ -292,11 +292,8 @@ module ActiveRecord 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 |