-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 7.1.0
-
Component/s: Query
-
None
-
Environment:Ruby 2.7.0
I have a 3rd party Ruby library that, prior to version 7.1, was able to call the subject method with a nil argument and receive back the results of Selectable#reset_strategies!. Now, Selectable#where raises an exception on a nil argument, which causes my application to crash.
I worked around my problem with a kludge that adds the following at the beginning of the version 7.1 Selectable#where function:
if criteria == [nil]
return self.reset_strategies!
end
Now my application runs fine. However, since I don't have a deep knowledge of Mongoid and ActiveRecord internals, I have no idea if this is reasonable or not.
In any case, if you can come up with a better solution, or some guidance about how the 3rd party vendor routine can get the desired result without calling Selectable#where(nil), I would appreciate it.
- is related to
-
MONGOID-4856 Exception message claims where without arguments is allowed, but it is not
- Closed
-
MONGOID-4857 Document and test how to reset merge strategies
- Backlog