1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Handle ranges with excluded end.

This commit is contained in:
Emilio Tagua 2010-03-29 12:31:25 -03:00
parent aa9559c399
commit 233ee77f45

View file

@ -111,7 +111,11 @@ module Arel
end
def in(array)
Predicates::In.new(self, array)
if array.is_a?(Range) && array.exclude_end?
[Predicates::GreaterThanOrEqualTo.new(self, array.begin), Predicates::LessThan.new(self, array.end)]
else
Predicates::In.new(self, array)
end
end
end
include Predications