-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
It looks like in Mongoid 3.0.15 all the way through 3.1.4, parent relationships are always saved.
In the Mongoid documentation section for autosaving, it only documents the autosaving of child objects, but not parent objects.
This can cause somewhat of a problem for people not expecting this (migrating from 2.x)
For example:
class User has_many :posts, :autosave => false # (this is documented to be false by default) end class Post belongs_to :user, :autosave => false # (this is not documented AFAIK, but is true by default) end
This actually caused us some pain causing some cascading saves upward. For example, if User belong to some other entity, then triggering a save on a Post will trigger a save on User and so on upwards.
This should probably either be documented or defaulted to false.