Make eager_load report if any associated models are in distinct clusters

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • 9.1.0
    • Affects Version/s: None
    • Component/s: Query
    • None
    • None
    • Ruby Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Unassigned
            Reporter:
            Jamis Buck
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: