aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/visitors/to_sql.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb
index cbe2b6cca3..5a92e27149 100644
--- a/lib/arel/visitors/to_sql.rb
+++ b/lib/arel/visitors/to_sql.rb
@@ -155,7 +155,9 @@ module Arel
end
def visit_Arel_Nodes_In o
- "#{visit o.left} IN (#{o.right.map { |x| visit x }.join ', '})"
+ right = o.right
+ right = right.empty? ? 'NULL' : right.map { |x| visit x }.join(', ')
+ "#{visit o.left} IN (#{right})"
end
def visit_Arel_Nodes_And o