Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

AO3-5111: Fix attribute_changed deprecation message #3007

Merged
merged 1 commit into from Aug 24, 2017

Conversation

Projects
None yet
3 participants
Owner

elzj commented Aug 24, 2017

Issue

https://otwarchive.atlassian.net/browse/AO3-5111

Purpose

Updates syntax in before save hook to remove deprecation warning.

Testing

The sanitizer version should still set properly, but there's no way to test that since we don't actually use it. Tests should run without a zillion deprecation warnings now.

@@ -6,7 +6,7 @@ class ApplicationRecord < ActiveRecord::Base
def update_sanitizer_version
ArchiveConfig.FIELDS_ALLOWING_HTML.each do |field|
- if self.respond_to?("#{field}_changed?") && self.send("#{field}_changed?")
+ if self.will_save_change_to_attribute?(field)
@houndci-bot

houndci-bot Aug 24, 2017

Redundant self detected.

@sarken sarken merged commit 110477f into otwcode:master Aug 24, 2017

3 checks passed

Scrutinizer No new issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
hound 1 violation found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment