We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 377f6f6 + ebd9661 commit 6828546Copy full SHA for 6828546
activerecord/lib/active_record/relation/predicate_builder/array_handler.rb
@@ -13,7 +13,7 @@ def call(attribute, value)
13
return attribute.in([]) if value.empty?
14
15
values = value.map { |x| x.is_a?(Base) ? x.id : x }
16
- nils = values.extract!(&:nil?)
+ nils = values.compact!
17
ranges = values.extract! { |v| v.is_a?(Range) }
18
19
values_predicate =
@@ -23,7 +23,7 @@ def call(attribute, value)
23
else Arel::Nodes::HomogeneousIn.new(values, attribute, :in)
24
end
25
26
- unless nils.empty?
+ if nils
27
values_predicate = values_predicate.or(attribute.eq(nil))
28
29
0 commit comments