This is useful for dynamically created predicates e.g: expr1 = table.create_false expr2 = table.create_false expr1 = create_a_predicate() if some_condition expr2 = create_another_predicate() if some_other_condition table.where(expr1.and(expr2))
Passing nil in array generates improper SQL
Conflicts: lib/arel.rb lib/arel/attributes/attribute.rb lib/arel/nodes/infix_operation.rb lib/arel/nodes/named_function.rb Conflicts: lib/arel.rb lib/arel/attributes/attribute.rb
Now, instead of the following SQL code: some_field IN (1, 2, NULL) Arel will generate the proper one: some_field IN (1, 2) OR IS NULL
…queries with very wide ranges that was caused by using Range#min and Range#max rather than Range#begin and Range#end. Ruby 1.8 uses Enumerable#min and Enumerable#max in Ranges, which calls to_a internally. It is not necessary to enumerate the range in order to construct the predicates. At the same time, an off-by-one error (failing test) with exclusive-end Ranges in Nodes::NotIn queries was fixed.