-
Type:
Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
According to the ActiveRecord docs, 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 MongoDB does not support multi-collection transactions at the moment, :autosave => true should be identical to no :autosave at all.