diff options
author | robertomiranda <rjmaltamar@gmail.com> | 2013-02-09 12:06:49 -0500 |
---|---|---|
committer | robertomiranda <rjmaltamar@gmail.com> | 2013-02-09 12:20:25 -0500 |
commit | 34eee28264e015158b95a29535945489222cbf27 (patch) | |
tree | 70c772f37b63090e7400b98fc4206f3c3de4d626 /activerecord/lib/active_record/relation | |
parent | da483d3f307a725d10fa3888df07d0bcbb14a0d2 (diff) | |
download | rails-34eee28264e015158b95a29535945489222cbf27.tar.gz rails-34eee28264e015158b95a29535945489222cbf27.tar.bz2 rails-34eee28264e015158b95a29535945489222cbf27.zip |
Use IN operator like arel for empty hash in where clause
Diffstat (limited to 'activerecord/lib/active_record/relation')
-rw-r--r-- | activerecord/lib/active_record/relation/predicate_builder.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/relation/predicate_builder.rb b/activerecord/lib/active_record/relation/predicate_builder.rb index 68d960f2b1..5cd015eba7 100644 --- a/activerecord/lib/active_record/relation/predicate_builder.rb +++ b/activerecord/lib/active_record/relation/predicate_builder.rb @@ -8,7 +8,7 @@ module ActiveRecord if value.is_a?(Hash) if value.empty? - queries << '1 = 2' + queries << '1=0' else table = Arel::Table.new(column, default_table.engine) association = klass.reflect_on_association(column.to_sym) |