Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MODEL] Fixed the handling of changed attributes in
Indexing
to wor…
…k with older Rails versions This patch builds on work in #738 by @jkeam and #758 by @Geesu to prevent deprecation warnings on Rails 5.1 due to changes in the handling of "changed attributes", originally reported by @davedash in #714. It's primary focus is to restore the compatibility with older Rails versions (so we don't break compatibility without proper version bump and in a single isolated commit), and to make the naming a bit more descriptive. First, the condition has been changed to work with the `changes_to_save` and `changes` methods, as opposed to the original `changed_attributes` / `attributes_in_database` naming. This communicates much more clearly the intent, and the original usage of `changed_attributes` has been misleading. Also, the "internal instance variable" which keeps track of the changes has been renamed to `@__changed_model_attributes`, in order to cleary differentiate it from the `changed_attributes` method name in older ActiveRecord versions. Closes #758
- Loading branch information
Showing
4 changed files
with
62 additions
and
26 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