Commits on Jan 16, 2011
  1. Bump version to rc.5

    durran committed Jan 16, 2011
Commits on Jan 15, 2011
  1. use the relationship name as foreign key. this is compatible with pre…

    …vious versions of mongoid
    Signed-off-by: David A. Cuadrado <>
    dcu committed Jan 15, 2011
  2. make sure a String is returned as foreign key

    Signed-off-by: David A. Cuadrado <>
    dcu committed Jan 15, 2011
  3. Relational associations no longer eager load and bind automatically:

    - 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.
    durran committed Jan 15, 2011
Commits on Jan 14, 2011
Commits on Jan 13, 2011
  1. Referenced::Many#count and Referenced::ManyToMany#count now properly go

    through the relation criteria and hit the database for the exact count.
    - #count will always hit the db, so the number returned may not actually
      match the number of documents in memory if for example a related
      document was persisted by another process.
    - Use #size or #length for number of docs in memory.
    - Fixes #542.
    durran committed Jan 13, 2011
  2. replSet config

    gilles committed Jan 13, 2011
Commits on Jan 12, 2011
  1. Fixing relation alias

    durran committed Jan 12, 2011
  2. Bumping to rc.4

    durran committed Jan 12, 2011
  3. Changing authors

    durran committed Jan 12, 2011
  4. Adding basic Criteria#update and #update_all:

    - At this point will only update all top level documents with an atomic
      $set operation, with :multi => true and whatever safe mode setting was
    durran committed Jan 12, 2011
  5. Whenever creating a new document via Document#new, never persist the

    child even if provided a persisted parent in the constructor.
    durran committed Jan 12, 2011
  6. adding labels to fields. Fixes #485.

    jasondew committed with durran Jul 20, 2010
  7. Add a failing spec for testing .=== of Document

    Ivan Ukhov committed with durran Jan 12, 2011
  8. Add a failing spec for testing the ManyToMany relation

    Ivan Ukhov committed with durran Jan 12, 2011
  9. Updating benchmarks for rc.4

    durran committed Jan 12, 2011
  10. Err on the side of less queries instead of an insane number.

    - When binding, eager load the relation once for relational associations
      so that the database query only happens a single time. Otherwise
      multiple duplicate queries would occur.
    - Dont set metadata on instantiation of relational associations, defer
      to loading.
    - Only embedded relations set metadata on proxy instantiation.
    durran committed Jan 12, 2011