MONGOID-5731 added a new eager_load method for returning an association tree via a single aggregation pipeline. The results are promising for many use cases, but we neglected to consider the case where associated models might exist in different clusters.
When eager_load is invoked, or maybe when the pipeline is built, we should inspect the associated models and ensure they all exist in the same cluster.
It would be nice to just fall back to the includes behavior in this case, but if that is non-trivial it can be deferred to a new ticket. At the very least, we should raise an exception, though.
- related to
-
MONGOID-5731 Add Criteria#eager_load method to use aggregation pipeline for eager loading
-
- Closed
-