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

cascade_callbacks works for save but not update_attributes

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

      class Parent
          include Mongoid::Document
          
         embeds_many :children, cascade_callbacks: true
      end
      
      class Child
         include Mongoid::Document
        
         mount_uploader :image, ImageUploader
      
         embedded_in :parent
      end
      

      `

      I am using Mongoid together with carrierwave. I have 2 classes like above. When I create a new Parent. parent.save works and the uploaded image got saved to the embedded child. But when I try to update a Parent, I cannot get the image to upload correctly using Parent.update_attriubutes().

            Assignee:
            durran Durran Jordan
            Reporter:
            benzheren Ben Hu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: