diff options
Diffstat (limited to 'lib/arel/visitors/to_sql.rb')
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index 8638bf43c3..761f315763 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -159,7 +159,6 @@ module Arel def visit_Arel_Nodes_Equality o right = o.right - # FIXME: maybe we should visit NilClass? if right.nil? "#{visit o.left} IS NULL" else @@ -167,6 +166,16 @@ module Arel end end + def visit_Arel_Nodes_NotEqual o + right = o.right + + if right.nil? + "#{visit o.left} IS NOT NULL" + else + "#{visit o.left} != #{visit right}" + end + end + def visit_Arel_Nodes_UnqualifiedColumn o "#{quote_column_name o.name}" end |