Skip to content

Commit 6cf3f6d

Browse files
Merge pull request rails#49876 from jonathanhefner/active_record-normalizes-marshalling_format_version-caveat
Add caveat about `normalizes` / `Marshal` interaction [ci-skip]
2 parents 4d0bc77 + 7faba03 commit 6cf3f6d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

activerecord/lib/active_record/normalization.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ module ClassMethods
4949
# By default, the normalization will not be applied to +nil+ values. This
5050
# behavior can be changed with the +:apply_to_nil+ option.
5151
#
52+
# Be aware that if your app was created before Rails 7.1, and your app
53+
# marshals instances of the targeted model (for example, when caching),
54+
# then you should set ActiveRecord.marshalling_format_version to +7.1+ or
55+
# higher via either <tt>config.load_defaults 7.1</tt> or
56+
# <tt>config.active_record.marshalling_format_version = 7.1</tt>.
57+
# Otherwise, +Marshal+ may attempt to serialize the normalization +Proc+
58+
# and raise +TypeError+.
59+
#
5260
# ==== Options
5361
#
5462
# * +:with+ - Any callable object that accepts the attribute's value as

0 commit comments

Comments
 (0)