This module contains the behaviour for auto-saving relations in different collections.
Begin the associated autosave.
@example Begin autosave.
document.__autosaving__
@since 3.1.3
# File lib/mongoid/relations/auto_save.rb, line 32 def __autosaving__ Threaded.begin_autosave(self) yield ensure Threaded.exit_autosave(self) end
Used to prevent infinite loops in associated autosaves.
@example Is the document autosaved?
document.autosaved?
@return [ true, false ] Has the document already been autosaved?
@since 3.0.0
# File lib/mongoid/relations/auto_save.rb, line 22 def autosaved? Threaded.autosaved?(self) end
Check if there is changes for auto-saving
@example Return true if there is changes on self or in
autosaved relations. document.changed_for_autosave?
@since 3.1.3
# File lib/mongoid/relations/auto_save.rb, line 46 def changed_for_autosave? new_record? || changed? || marked_for_destruction? end
Generated with the Darkfish Rdoc Generator 2.