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

Mongoid should support association callbacks

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.1.0
    • Component/s: None
    • Labels:

      Description

      Similar to ActiveRecord Mongoid should support the "before_add", "after_add", "before_remove", "after_remove" callbacks

      Here is the ActiveRecord documentation: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html

      There isn't even really a workaround currently as before_save doesn't call on the parent due to the atomic push.

      A previous issue MONGOID-463 mentions this same issue and references a mysterious pull request that included this functionality.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            nader Nader Akhnoukh
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: