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

Mongoid should support association callbacks

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.1.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:

      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.

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

              Created:
              Updated:
              Resolved: