mongoid/mongoid — Issue #1679: Behavior of :autosave not consistent with ActiveRecord
Author: behrangsa
Created: 2012-02-06 08:05:43+00:00
State: open

According to the ActiveRecord [docs](http://api.rubyonrails.org/classes/ActiveRecord/AutosaveAssociation.html), even when `:autosave` is not present on an association, saving a parent model saves its associated child models as well.

What `:autosave` does, is to *save them in the same transaction* as the parent model:

> Note that :autosave => false is not same as not declaring :autosave. When the :autosave option is not present new associations are saved.

So I think even when `:autosave => true` is absent, Mongoid should still save the children. However when `:autosave => false` is specified, the children should not be automatically saved.

As Mongoid does not support multi collection transactions at the moment, `:autosave => true` should be identical to no `:autosave` at all.