Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5714

Consider reinstating around_* callbacks for embedded documents

    • Type: Icon: Question Question
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Associations
    • None

      • In the 9.0 changelog, I see that around_* callbacks for embedded documents are now ignored.
      • The changelog entry says "See MONGOID-5658 for details", but nowhere in that ticket or its thread gives any details as to why specifically around_* was removed.
      • Additionally the author of MONGOID-5658 does not mention around_*, nor does their code example have any user-defined callbacks all.
      • Moreover, the user notes the issue worked fine in Mongoid 7.x but broke in 8.x.

      Given this, please:

      1. Clarify why around_* callbacks were removed for embedded?
      2. Clarify why before/after_* are not removed (or are they?)
      3. Explain what avenues were explored to keep around_* for callbacks? For example, would it be possible to "flatten the stack" so that callbacks are enqueued (i.e. "registered") on the parent object, and we iterate over the queue rather than using recursion?

            Assignee:
            Unassigned Unassigned
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: