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

Relations validations doesn't work as expected

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.2
    • Affects Version/s: None
    • Component/s: None
    • None

      Imagine you have 2 documents

      class User
            embeds_one :pet, validate: false
      end
      
      class Pet
          embedded_in :user
      end
      

      It should be OK if you want to save user with invalid pet (because of validate: false).

      But it seems validate: false option doesn't work as expected, and you'll get validation error when you wan't to store user with invalid pet!

      My Mongoid version is 4.0.2

            Assignee:
            dianna.hohensee@mongodb.com Dianna Hohensee (Inactive)
            Reporter:
            EhsanYousefi EhsanYousefi [X]
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: