Skip to content

Commit 0a7b4b4

Browse files
MONGOID-5658 Fix callbacks for embedded (#5727)
* 5658 * 5658 * 5658 * Document the config option * Add warning * Add docstrings * Update for ActiveSupport 7.1 * Add test case * Add release notes * Update specs
1 parent 996672e commit 0a7b4b4

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

source/release-notes/mongoid-9.0.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,23 @@ please consult GitHub releases for detailed release notes and JIRA for
1818
the complete list of issues fixed in each release, including bug fixes.
1919

2020

21+
``around_*`` callbacks for embedded documents are now ignored
22+
-------------------------------------------------------------
23+
24+
Mongoid 8.x and older allows user to define ``around_*`` callbacks for embedded
25+
documents. Starting from 9.0 these callbacks are ignored and will not be executed.
26+
A warning will be printed to the console if such callbacks are defined.
27+
28+
If you want to restore the old behavior, you can set
29+
``Mongoid.around_embedded_document_callbacks`` to true in your application.
30+
31+
.. note::
32+
Enabling ``around_*`` callbacks for embedded documents is not recommended
33+
as it may cause ``SystemStackError`` exceptions when a document has many
34+
embedded documents. See `MONGOID-5658 <https://jira.mongodb.org/browse/MONGOID-5658>`_
35+
for more details.
36+
37+
2138
``for_js`` method is deprecated
2239
-------------------------------
2340

0 commit comments

Comments
 (0)