File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1
1
.. _mongoid-odm-landing:
2
2
.. _mongoid-odm:
3
3
4
- ================================
4
+ ====================================
5
5
{+odm+}: The ODM for MongoDB in Ruby
6
- ================================
6
+ ====================================
7
7
8
8
.. toctree::
9
9
:titlesonly:
Original file line number Diff line number Diff line change @@ -30,6 +30,26 @@ fixes:
30
30
as raw hashes. To learn more, see the :ref:`mongoid-raw-results`
31
31
section of the Modify Query Results guide.
32
32
33
+ - Improves caching functionality by modifying the behavior of
34
+ ``cache_key`` to *not* embed a timestamp when ``cache_version``
35
+ returns a non-nil value. Instead, the timestamp is used as the version
36
+ for the entry to reduce key churn.
37
+
38
+ This change also adds the ``cache_version`` method to the
39
+ ``Mongoid::Document`` module. If the cache key format introduced in
40
+ this version poses an issue in your application, you can revert to
41
+ the original format by defining the ``cache_version`` method as
42
+ ``nil``:
43
+
44
+ .. code-block:: ruby
45
+ :emphasize-lines: 3
46
+
47
+ module Mongoid
48
+ module Document
49
+ def cache_version = nil
50
+ end
51
+ end
52
+
33
53
.. _mongoid-version-9.0:
34
54
35
55
What's New in 9.0
You can’t perform that action at this time.
0 commit comments