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

Callback that doesn't exist is being called because of cascaded callbacks

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

      I think this problem is related to MONGOID-1888

      I'm using mongoid-tree like the related issue and I'm getting the error {{NoMethodError (undefined method }}_run_rearrange_callbacks' for #<Ingredient:0x007f91343cea20>):`

      In this case Ingredient is an embed document and I have cascading callbacks on it. The problem only seems to happen when I try to destroy an embed document using _destroy in the parent's _attributes. In my simple debugging of the situation I think what is happening is the children array in cascadable_children is adding the embed model because it responds to validation and so even though it doesn't respond to rearrange it still is in the array and the callbacks get added. I'm not 100% sure how all this works so I might be wrong.

            Assignee:
            durran Durran Jordan
            Reporter:
            hadees hadees
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: