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

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

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

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            visnup Visnu Pitiyanuvath
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: