Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add ToSql NilClass visitor

  • Loading branch information...
commit afb6f9c5c1de606c10eca6967010eaa4bfde263b 1 parent 01e7cee
@ernie ernie authored tenderlove committed
Showing with 5 additions and 0 deletions.
  1. +1 −0  lib/arel/visitors/to_sql.rb
  2. +4 −0 test/visitors/test_to_sql.rb
View
1  lib/arel/visitors/to_sql.rb
@@ -277,6 +277,7 @@ def visit_String o; quote(o, @last_column) end
alias :visit_Symbol :visit_String
alias :visit_Time :visit_String
alias :visit_TrueClass :visit_String
+ alias :visit_NilClass :visit_String
def quote value, column = nil
@connection.quote value, column
View
4 test/visitors/test_to_sql.rb
@@ -45,6 +45,10 @@ module Visitors
@visitor.accept Date.today
end
+ it "should visit_NilClass" do
+ @visitor.accept(nil).must_be_like "NULL"
+ end
+
it "should visit_Arel_Nodes_And" do
node = Nodes::And.new @attr.eq(10), @attr.eq(11)
@visitor.accept(node).must_be_like %{
Please sign in to comment.
Something went wrong with that request. Please try again.