diff --git a/app/models/actions/contact_update.rb b/app/models/actions/contact_update.rb index 5b94cf918..f8b39ecb4 100644 --- a/app/models/actions/contact_update.rb +++ b/app/models/actions/contact_update.rb @@ -23,7 +23,7 @@ module Actions end def maybe_remove_address - return if Setting.address_processing? + return if Contact.address_processing? new_attributes.delete(:city) new_attributes.delete(:zip) diff --git a/app/models/contact.rb b/app/models/contact.rb index a2057f229..4199e6dc7 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -62,7 +62,7 @@ class Contact < ApplicationRecord mapping: [%w[ident code], %w[ident_type type], %w[ident_country_code country_code]] after_save :update_related_whois_records - before_save :clear_address_modifications, if: -> { !self.class.address_processing? } + before_validation :clear_address_modifications, if: -> { !self.class.address_processing? } self.ignored_columns = %w[legacy_id legacy_history_id]