@@ -37,11 +37,11 @@ Mongoid supports the following callbacks for :doc:`documents </tutorials/documen
3737- ``after_destroy``
3838
3939Callbacks are available on any document, whether it is embedded within
40- another document or not. Note that to be efficient, Mongoid only fires
41- the callback of the document that the persistence action was executed on.
42- This is that Mongoid aims to support large hierarchies and to handle
43- optimized atomic updates callbacks can't be firing all over the document
44- hierarchy.
40+ another document or not. Note that to be efficient, Mongoid only invokes
41+ the callback on the document that the persistence action was executed on.
42+ This enables Mongoid to support large hierarchies and to handle optimized
43+ atomic updates efficiently (without invoking callbacks throughout the document
44+ hierarchy) .
4545
4646Note that using callbacks for domain logic is a bad design practice, and can
4747lead to unexpected errors that are hard to debug when callbacks in
@@ -82,20 +82,20 @@ syntax as well:
8282 end
8383 end
8484
85+
8586Association Callbacks
8687=====================
8788
88- Mongoid has a set of callbacks that are specific to collection based
89- associations - these are:
89+ Mongoid has a set of callbacks that are specific to associations - these are:
9090
9191- ``after_add``
9292- ``after_remove``
9393- ``before_add``
9494- ``before_remove``
9595
96- Each time a document is added or removed from any of the following associations,
97- the respective callbacks are invoked: ``embeds_many``,
98- ``has_many``, and ``has_and_belongs_to_many``.
96+ Each time a document is added or removed from any of the following
97+ associations, the respective callbacks are invoked: ``embeds_many``,
98+ ``has_many`` and ``has_and_belongs_to_many``.
9999
100100Association callbacks are specified as options on the respective association.
101101The document added/removed will be passed as the parameter to the specified
0 commit comments