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 11.. _mongoid-odm-landing:
22.. _mongoid-odm:
33
4- ================================
4+ ====================================
55{+odm+}: The ODM for MongoDB in Ruby
6- ================================
6+ ====================================
77
88.. toctree::
99 :titlesonly:
Original file line number Diff line number Diff line change @@ -30,6 +30,26 @@ fixes:
3030 as raw hashes. To learn more, see the :ref:`mongoid-raw-results`
3131 section of the Modify Query Results guide.
3232
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+
3353.. _mongoid-version-9.0:
3454
3555What's New in 9.0
You can’t perform that action at this time.
0 commit comments