Permalink
Commits on Aug 29, 2011
Commits on Aug 28, 2011
  1. Merge branch '2.1.0-stable' into 2.2.0-stable

    Conflicts:
    	lib/mongoid/relations/embedded/one.rb
    cgriego committed Aug 28, 2011
  2. Bumping version to 2.2.0

    durran committed Aug 28, 2011
  3. Raise Errors::EagerLoad when trying to eager load many-to-many:

    - All benchmarks show the extra query to get all the ids to be slower
      than executing the queries individually. This is before even setting
      the documents in the identity map.
    durran committed Aug 28, 2011
Commits on Aug 27, 2011
  1. Gradual refactoring of the eager loading code:

    - Moving common functionality on loading ids back into the criteria
      object.
    - Benchmarks still indicating around a cut in half of load times up to
      10k documents.
    durran committed Aug 27, 2011
  2. Add additional stability to identity map:

    - When querying for ids only to generate the eager load query, Mongoid
      now uses the ruby driver collection directly, and not the Mongoid
      wrapped one. There is no need to instantiate a document object when
      all we want is an array of ids.
    
    - Adding more specs around the expected collection behaviour when
      querying to assure no excess queries are happening.
    durran committed Aug 27, 2011
Commits on Aug 26, 2011
  1. Replacing 1-n relational child documents does not always delete:

    - When relacing a 1-n relation the existing child documents will now
      follow the proper cascade strategy that was set on the relation:
      :delete, :destroy, :nullify.
    
    - If a dependent strategy was not defined, we assume nullify.
    
    - Fixes #1173.
    durran committed Aug 26, 2011
  2. Enumerable#first should first return added doc:

    - Always try to grab what is in memory first to avoid rebinds and extra
      database hits.
    - Fixes #1176.
    durran committed Aug 26, 2011
Commits on Aug 25, 2011
  1. Removing todo

    durran committed Aug 25, 2011
  2. Hold off on persistence of embedded docs:

    - Now Mongoid's atomic operations on embedded docs fall into 4
      categories: $set, $unset, $pushAll, $pullAll.
    - When setting attributes without saving the parent document, Mongoid
      now waits to persist the child changes until the parent is saved. This
      differs from the instant saves and deletes that were happening
      previously.
    - Any combination of additions, modifications and deletions can be
      combined, most commonly by using nested attributes. Mongoid will group
      these into the appropriate atomic ops, and also determine if there are
      conflicting modifications and split the persistence up if necessary.
    - Fixes #1142.
    - Fixes #767.
    
    - This may be revisited in favor of a single $set operation.
    durran committed Aug 25, 2011
Commits on Aug 24, 2011
  1. Do not autosave embedded relation on parent update:

    - This is part 1 of a 2 phase commit.
    
    - This commit addresses all issues of the child save with the exception
      of nested attributes deletion.
    
    - In the following cases the child document will no longer save unless
      explicitly called or the parent is saved:
    
      model.attributes = { :child => value }
      model.attributes = { :child => nil }
      model.child_attributes = { :field => value }
      model.child_attributes = {{}}
    durran committed Aug 24, 2011
  2. Merge pull request #1184 from dblock/to-json-options-passthrough

    Added as_json to enumerables, same problem as with to_json.
    durran committed Aug 24, 2011
  3. Typo in method description.

    dblock committed Aug 24, 2011
  4. Mongoid now properly converts criteria object ids:

    - Instead of using a regex to look for "id" in the field name, Mongoid
      now looks for the field definition directly on the class and attempts
      conversion only if that field is a BSON::ObjectId.
    
    - Note this will always assume true for polymorphic relation foreign
      keys at the moment which will be revisited later. This is still much
      more accurate than previously.
    
    - Closes #1180.
    - Closes #955.
    durran committed Aug 24, 2011
Commits on Aug 23, 2011
  1. Merge pull request #1181 from dblock/to-json-options-passthrough

    Bug: enumerable.to_json should pass options through
    durran committed Aug 23, 2011
  2. Raise callbacks error in persistence bang methods:

    - When a callback returns false, raise a Mongoid::Errors::Callback when
      happening in create!, save! and update_attributes! instead of a
      validations error.
    
    - Closes #909.
    durran committed Aug 23, 2011