diff options
author | Thomas Kienlen <t.kienlen@adhoc-gti.com> | 2017-02-02 15:16:22 +0100 |
---|---|---|
committer | Thomas Kienlen <t.kienlen@adhoc-gti.com> | 2017-02-02 15:16:22 +0100 |
commit | d8a41890e0135666606167e8ea7e62b951863de6 (patch) | |
tree | ba77ab3b999424bbb1a98a6c124c948a5c594611 | |
parent | d6af2090b16f7d061aa43913d610c6fada58b7e2 (diff) | |
download | rails-d8a41890e0135666606167e8ea7e62b951863de6.tar.gz rails-d8a41890e0135666606167e8ea7e62b951863de6.tar.bz2 rails-d8a41890e0135666606167e8ea7e62b951863de6.zip |
named functions compared to nil
-rw-r--r-- | test/visitors/test_to_sql.rb | 6 |
1 files changed, 6 insertions, 0 deletions
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) |