From d8a41890e0135666606167e8ea7e62b951863de6 Mon Sep 17 00:00:00 2001 From: Thomas Kienlen Date: Thu, 2 Feb 2017 15:16:22 +0100 Subject: named functions compared to nil --- test/visitors/test_to_sql.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/visitors/test_to_sql.rb b/test/visitors/test_to_sql.rb index e31d60366b..e7734e2814 100644 --- a/test/visitors/test_to_sql.rb +++ b/test/visitors/test_to_sql.rb @@ -61,6 +61,12 @@ module Arel sql.must_be_like %{ omg(*) = 2 } end + it 'should handle nil with named functions' do + function = Nodes::NamedFunction.new('omg', [Arel.star]) + sql = compile(function.eq(nil)) + sql.must_be_like %{ omg(*) IS NULL } + end + it 'should visit built-in functions' do function = Nodes::Count.new([Arel.star]) assert_equal 'COUNT(*)', compile(function) -- cgit v1.2.3