I need to achieve something like:
queryable.any_of(
between(:average_nightly_min_price, [10,100]),
between(:average_nightly_max_price, [110,1100])
)
is it possible using the combination of any_of
and between
. Or any other alternatives?
It does not work if the queryable is embeded.
For ruby versions prior 2.0:
I also got an
ArgumentError
(like @christofferjoergensen), but withmongoid 3.1.5
Using the hashrocket syntax instead of passing two arguments solved it: