From f48061a54fd3d2cfd7ee7a3dbce0eb45798fd40f Mon Sep 17 00:00:00 2001 From: oleghasjanov Date: Wed, 4 Jun 2025 14:04:48 +0300 Subject: [PATCH] changed from after_save to after_commit --- app/models/contact.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index b51100fe8..1e59c2cd2 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -85,7 +85,8 @@ class Contact < ApplicationRecord 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? } # TODO: remove after testing @@ -546,7 +547,8 @@ class Contact < ApplicationRecord 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 Rails.logger.info "names: #{names}"