diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-04-23 12:30:18 +0300 |
---|---|---|
committer | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-04-30 10:24:25 +0300 |
commit | fc22626f453f64409ad5b2967cdec541dbcc041d (patch) | |
tree | 9686c1c160af34db2038c241ab7f0b665f1c51a0 /app/models/remote_mirror.rb | |
parent | a2543ee29a97f61f960994d473291c7224c50c3d (diff) |
Remove deprecated uses of attribute_changed?
Prepares us for upgrade to Rails 5.2
Diffstat (limited to 'app/models/remote_mirror.rb')
-rw-r--r-- | app/models/remote_mirror.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/remote_mirror.rb b/app/models/remote_mirror.rb index 535f772b6a1..cbfc1a7c1b2 100644 --- a/app/models/remote_mirror.rb +++ b/app/models/remote_mirror.rb @@ -22,8 +22,8 @@ class RemoteMirror < ApplicationRecord before_save :set_new_remote_name, if: :mirror_url_changed? after_save :set_override_remote_mirror_available, unless: -> { Gitlab::CurrentSettings.current_application_settings.mirror_available } - after_save :refresh_remote, if: :mirror_url_changed? - after_update :reset_fields, if: :mirror_url_changed? + after_save :refresh_remote, if: :saved_change_to_mirror_url? + after_update :reset_fields, if: :saved_change_to_mirror_url? after_commit :remove_remote, on: :destroy @@ -265,4 +265,8 @@ class RemoteMirror < ApplicationRecord def mirror_url_changed? url_changed? || credentials_changed? end + + def saved_change_to_mirror_url? + saved_change_to_url? || saved_change_to_credentials? + end end |