File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,30 @@ The complete list of releases is available `on GitHub
1717please consult GitHub releases for detailed release notes and JIRA for
1818the complete list of issues fixed in each release, including bug fixes.
1919
20+ ``touch`` method now clears changed state
21+ -----------------------------------------
22+
23+ In Mongoid 8.x and older ``touch`` method leaves models in the changed state:
24+
25+ .. code-block:: ruby
26+
27+ # Mongoid 8.x behaviour
28+ band = Band.create!
29+ band.touch
30+ band.changed? # => true
31+ band.changes # => {"updated_at"=>[2023-01-30 13:12:57.477191135 UTC, 2023-01-30 13:13:11.482975646 UTC]}
32+
33+ Starting from 9.0 Mongoid now correctly clears changed state after using ``touch``
34+ method.
35+
36+ .. code-block:: ruby
37+
38+ # Mongoid 9.0 behaviour
39+ band = Band.create!
40+ band.touch
41+ band.changed? # => false
42+ band.changes # => {}
43+
2044Sandbox Mode for Rails Console
2145------------------------------
2246
You can’t perform that action at this time.
0 commit comments