mirror of
https://github.com/internetee/registry.git
synced 2025-07-26 04:28:27 +02:00
Add logging to archiving process
This commit is contained in:
parent
b2dab0d316
commit
816102130b
3 changed files with 20 additions and 7 deletions
|
@ -2,13 +2,10 @@ namespace :contacts do
|
|||
desc 'Archives inactive contacts'
|
||||
|
||||
task archive: :environment do
|
||||
puts 'Starting to gather archivable contacts'
|
||||
inactive_contacts = InactiveContacts.new
|
||||
archived_contacts = inactive_contacts.archive
|
||||
|
||||
archived_contacts.each do |contact|
|
||||
puts "Contact ##{contact.id} (code: #{contact.code}) is archived"
|
||||
end
|
||||
|
||||
puts "Archived total: #{archived_contacts.count}"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue