-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
Ranges can be either end-inclusive or end-exclusive.
An end-inclusive range, with 2 periods, looks like:
(3 .. 7).to_a
#=> [3, 4, 5, 6, 7]
An end-exclusive range, with 3 periods, looks like:
(3 ... 7).to_a
#=> [3, 4, 5, 6]
Mongoid handles end-inclusive ranges correctly, with:
{"$gte" => 3, "$lte" => 7}But it should also handle end-exclusive ranges correctly, with:
{"$gte" => 3, "$lt" => 7}Mongoid currently ignores whether a range is end-exclusive, and always generates queries as though the range were end-inclusive.
This is tested as of v2.5.1.