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

Autosave is not validating associated models

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

      having this model:

      belongs_to :contact, autosave: true
      validates_presence_of :contact
      

      In theory, because it has autosave: true it should validate associated models before save. But I am forced to add this line if I want this nested validation:

      validates_associated :contact

      Better explanation here:
      http://stackoverflow.com/questions/31469886/having-a-rails-model-with-autosave-should-i-validate-associated

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            martinezcoder martinezcoder
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: