Skip to content

Commit

Permalink
fix rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jun 2, 2020
1 parent 2cf828f commit a3089df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tasks/client.rake
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,15 @@ namespace :client do
puts "#{response.count} client prefixes deleted."

if prefix_ids.present?
response = ProviderPrefix.where('prefixes IN (?)', prefix_ids).destroy_all
response = ProviderPrefix.where('prefix_id IN (?)', prefix_ids).destroy_all
puts "#{response.count} provider prefixes deleted."
end

# update dois
Doi.transfer(from_date: "2011-01-01", client_id: client.symbol, client_target_id: target.symbol)

prefixes.each do |prefix|
puts prefix
provider_prefix = ProviderPrefix.create(provider: target.provider, prefix: prefix)
puts "Provider prefix for provider #{target.provider.symbol} and prefix #{prefix} created."
client_prefix = ClientPrefix.create(client: target, prefix: prefix, provider_prefix: provider_prefix.id)
Expand Down

0 comments on commit a3089df

Please sign in to comment.