-
Notifications
You must be signed in to change notification settings - Fork 21.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define missing attribute methods from
method_missing
Ref: mastodon/mastodon#27622 If applications don't eager load and use the old Rails 6.1 Marshal format, they can load Active Record instances from caches without calling `init_internals` hence attribute methods and aliases are nnot defined yet, leading to `NoMethodError` Initially I was hopping to fully get rid of the `define_attribute_methods` call in `init_internals` in favor of this new method missing, as it would remove work from the happy path, unfortunately that isn't possible because if a generated method overrides a default method inherited from object, `method_missing` won't be called. e.g. `Kernel#format` We may want to get rid of this extra code once we remove support for the 6.1 marshal format.
- Loading branch information
Showing
7 changed files
with
86 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+1.94 KB
activerecord/test/support/marshal_compatibility_fixtures/SQLite/rails_6_1_aliased_topic.dump
Binary file not shown.