Skip to content
Commits on Jan 17, 2011
  1. @durran

    Validation context should default to proper context instead of none:

    durran committed
    - When no context provided to Document#valid? use the following
      defaults: :create if new, :update if persisted.
    - Slight refactoring of the include annoyance in the validations module.
    - Mongoid now includes ActiveModel::Validations::Callbacks
    - Initialize callback runs only :after.
    - Fixes #556.
  2. @durran
Commits on Jan 15, 2011
  1. @durran

    Relational associations no longer eager load and bind automatically:

    durran committed
    - Up to now on this release candidate, all associations when accessed
      would load and bind their inverses. This caused huge problems when
      trying to do simple scoped database calls that did not need the
      objects in memory on large datasets. (Tested with over a million)
    - Methods affected by this performance drag were #count and any criteria
      chain off the association itself.
    - From now on by default relational associations are lazy loaded and
      will only load into memory and bind when performing array operations
      on the association that would modify its contents. (<<, push, delete,
    - Embedded relations are still eager loaded and bound to their inverses
      on access.
    - By providing an :eager => true to the getter or setter for the
      relation, you can force an eager load into memory.
    - This commit also fixes all issues with multiple duplicate queries
      running for the relational associations. From now on, once a query has
      been executed for the relation, it will never be executed again while
      the object stays in memory unless a forced reload occurs:
    - This is also a prep commit for the specific eager loading pull
      request, which will provide the ability to specify an :include to
      eager load specific associations into memory.
Commits on Jan 10, 2011
  1. @durran
  2. @durran
Commits on Jan 5, 2011
  1. @durran

    Needed to override ActiveModel's #read_attribute_for_validation in order

    durran committed
    to prevent excessive binding of relations when they were being
    validated. Also cleaned up continuation code to ensure reloading was not
    happening of the documents accidentally.
Commits on Jan 2, 2011
  1. @durran

    Relations defined as "child" relations (embeds_many, embeds_one,

    durran committed
    references_many, references_one, references_and_referenced_in_many) now
    have associated validations turned on by default. In order to turn this
    off the macro must explicitly tell it to:
      class Person
        include Mongoid::Document
        embeds_many :addresses, :validate => false
    This fixes #220.
Commits on Dec 24, 2010
  1. @durran
Commits on Jul 30, 2010
  1. @durran
Commits on Mar 26, 2010
  1. @durran
Commits on Mar 24, 2010
  1. @durran
Commits on Feb 11, 2010
  1. @durran
Commits on Jan 27, 2010
  1. @brainopia
Commits on Jan 17, 2010
  1. @durran

    Rails 3 validations:

    durran committed
    - Removed dependency on durran-validatable
    - Added inclusion of ActiveModel::Validations
    - Added uniqueness validation
    - Added associated validation
Something went wrong with that request. Please try again.