-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Override _read_attribute in Dirty plugin
This is required due to a fix in AR 5.2: rails/rails#28661 Previously, `__send__` was used to fetch the value of the attribute before changes, which worked fine with locale accessors like `title_en`. However, with the fix above, `@attributes` is now used, which does not contain translated attributes (let alone locale accessors). Since in general, locale accessors are an open-ended set, we can't treat them the way normal attributes are treated, so we resort to overriding `_read_attribute` to check if the attribute that has changed is one that Mobility changed, and if so use `__send__`. This fixes the issue, although overriding a private method is not ideal.
- Loading branch information
Showing
2 changed files
with
58 additions
and
17 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