1
0
Fork 0
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:
Sean Griffin 2014-11-02 12:00:04 -07:00
parent 54798211ff
commit b364cb1083

View file

@ -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)