-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 5.0.1, 5.1.0
-
Component/s: None
-
None
When building queries for embedded documents, if one scope calls another that uses an order_by(), then the query acts as if the embedded document is not embedded and queries for the non-existant collection.
See attached example code. Log entries showing the incorrect queries against "insides" are also generated.
Including the order_by() in the parent scope works correctly.
Tested and confirmed as broken in 5.0.1, 5.0.0-stable, and master. Worked in Mongoid 4.