lib/arel/extensions/equality.rb in arel_toolkit-0.2.0 vs lib/arel/extensions/equality.rb in arel_toolkit-0.3.0

- old
+ new

@@ -4,18 +4,16 @@ module Arel module Visitors class ToSql def visit_Arel_Nodes_Equality(o, collector) right = o.right - collector = visit o.left, collector - case right - when Arel::Nodes::Unknown, Arel::Nodes::False, Arel::Nodes::True + if [Arel::Nodes::Unknown, Arel::Nodes::False, Arel::Nodes::True].include?(right.class) collector << ' IS ' visit right, collector - when NilClass + elsif right.nil? collector << ' IS NULL' else collector << ' = ' visit right, collector