changed from after_save to after_commit

This commit is contained in:
oleghasjanov 2025-06-04 14:04:48 +03:00
parent cf63e56c9f
commit f48061a54f

View file

@ -85,7 +85,8 @@ class Contact < ApplicationRecord
country_code: country_code) }, country_code: country_code) },
mapping: [%w[ident code], %w[ident_type type], %w[ident_country_code country_code]] mapping: [%w[ident code], %w[ident_type type], %w[ident_country_code country_code]]
after_save :update_related_whois_records # after_save :update_related_whois_records
after_commit :update_related_whois_records
before_validation :clear_address_modifications, if: -> { !self.class.address_processing? } before_validation :clear_address_modifications, if: -> { !self.class.address_processing? }
# TODO: remove after testing # TODO: remove after testing
@ -546,7 +547,8 @@ class Contact < ApplicationRecord
Rails.logger.info "Saved changes: #{saved_changes}" Rails.logger.info "Saved changes: #{saved_changes}"
return if saved_changes.slice(*(self.class.column_names - ignored_columns)).empty? # return if saved_changes.slice(*(self.class.column_names - ignored_columns)).empty?
return if (previous_changes.keys - ignored_columns).empty?
names = related_domain_descriptions.keys names = related_domain_descriptions.keys
Rails.logger.info "names: #{names}" Rails.logger.info "names: #{names}"