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

nullifying, deleting or destroying an embedded document doesn't trigger validations on base document

      class A
        include Mongoid::Document
        embeds_one :b
        validates_presence_of :b
      end
      
      class B
        include Mongoid::Document
        embedded_in :a
      end
      
      > a=A.new
      > a.b=B.new
      > a.save
      => true
      > a.b=nil   (it saves the document skipping 'a' validations)
      > A.last.b
      => nil
      > A.last.valid?
      => false
      

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            ghost Deleted user
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: