aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/predications.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arel/predications.rb')
-rw-r--r--lib/arel/predications.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/arel/predications.rb b/lib/arel/predications.rb
index 75c4c75855..44059a54fe 100644
--- a/lib/arel/predications.rb
+++ b/lib/arel/predications.rb
@@ -41,7 +41,17 @@ module Arel
Nodes::Between.new(self, Nodes::And.new([other.begin, other.end]))
end
else
- Nodes::In.new self, other
+ if other.include?(nil)
+ if other.size > 1
+ set = Nodes::In.new self, other.compact
+ null = Nodes::Equality.new self, nil
+ Nodes::Or.new set, null
+ else
+ Nodes::Equality.new self, nil
+ end
+ else
+ Nodes::In.new self, other
+ end
end
end