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

Change :validate => true on relations to validating only what's in memory

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 12_01_17
    • Component/s: None
    • Labels:
      None

      Description

      This turned out to be way simpler than I expected. I could use more eyes on it though, especially testing it out in projects outside of the current mongoid test suite.

      Referential validations no longer load the entire relation from the db with :validates => true being set.

      If you want the old behavior, use validates_associated:

      class Person
      references_many :posts
      validates_associated :posts
      end

      Since :validates => true is now a sane default, it's been turned back on in all the relations used in the specs.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: