Permalink
Browse files

Use IN operator like arel for empty hash in where clause

  • Loading branch information...
1 parent da483d3 commit 34eee28264e015158b95a29535945489222cbf27 @robertomiranda robertomiranda committed Feb 9, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/relation/predicate_builder.rb
@@ -8,7 +8,7 @@ def self.build_from_hash(klass, attributes, default_table)
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)

0 comments on commit 34eee28

Please sign in to comment.