Skip to content

Commit

Permalink
Merge pull request #682 from datacite/remove_clients_first
Browse files Browse the repository at this point in the history
Remove client prefixes first before adding them.
  • Loading branch information
richardhallett authored Nov 27, 2020
2 parents 656e35b + f53b203 commit 6ece672
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ def transfer_prefixes(provider_target_id: nil)
if prefix_ids.present?
response = ProviderPrefix.where("prefix_id IN (?)", prefix_ids).destroy_all
Rails.logger.info "[Transfer][Prefix] #{response.count} provider prefixes deleted. #{prefix_ids}"

response = ClientPrefix.where("prefix_id IN (?)", prefix_ids).destroy_all
Rails.logger.info "[Transfer][Prefix] #{response.count} client prefixes deleted. #{prefix_ids}"
end

# Assign prefix(es) to provider and client
Expand Down

0 comments on commit 6ece672

Please sign in to comment.