mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Look for Enumerable
rather than Array
in predicates
It's not quite duck typed, but it will allow us to pass in our own objects with additional logic (like type casting).
This commit is contained in:
parent
54798211ff
commit
b364cb1083
1 changed files with 2 additions and 2 deletions
|
@ -55,7 +55,7 @@ Passing a range to `#in` is deprecated. Call `#between`, instead.
|
|||
eowarn
|
||||
end
|
||||
between(other)
|
||||
when Array
|
||||
when Enumerable
|
||||
Nodes::In.new self, quoted_array(other)
|
||||
else
|
||||
Nodes::In.new self, quoted_node(other)
|
||||
|
@ -103,7 +103,7 @@ Passing a range to `#not_in` is deprecated. Call `#not_between`, instead.
|
|||
eowarn
|
||||
end
|
||||
not_between(other)
|
||||
when Array
|
||||
when Enumerable
|
||||
Nodes::NotIn.new self, quoted_array(other)
|
||||
else
|
||||
Nodes::NotIn.new self, quoted_node(other)
|
||||
|
|
Loading…
Reference in a new issue