diff --git a/app/models/client.rb b/app/models/client.rb index 0d2e8e2d7..558a651a0 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -510,6 +510,8 @@ def transfer(provider_target_id: nil) return nil end + Rails.logger.info "[Transfer] Client transfer starting from #{provider_id} to #{target_provider.id}" + # Transfer client update_attribute(:allocator, target_provider.id) @@ -535,11 +537,8 @@ def transfer_prefixes(provider_target_id: nil) prefixes_names = associated_prefixes.pluck(:uid) if prefix_ids.present? - response = - ProviderPrefix.where("prefix_id IN (?)", prefix_ids).destroy_all - Rails.logger.info "[Transfer] #{ - response.count - } provider prefixes deleted." + response = ProviderPrefix.where("prefix_id IN (?)", prefix_ids).destroy_all + Rails.logger.info "[Transfer][Prefix] #{response.count} provider prefixes deleted. #{prefix_ids}" end # Assign prefix(es) to provider and client @@ -548,7 +547,7 @@ def transfer_prefixes(provider_target_id: nil) ProviderPrefix.create( provider_id: provider_target_id, prefix_id: prefix, ) - Rails.logger.info "[Transfer] Provider prefix for provider #{ + Rails.logger.info "[Transfer][Prefix] Provider prefix for provider #{ provider_target_id } and prefix #{prefix} created." @@ -557,7 +556,7 @@ def transfer_prefixes(provider_target_id: nil) provider_prefix_id: provider_prefix.uid, prefix_id: prefix, ) - Rails.logger.info "Client prefix for client #{symbol} and prefix #{ + Rails.logger.info "[Transfer][Prefix] Client prefix for client #{symbol} and prefix #{ prefix } created." end