Refactor inactive contact archivation

Fixes #956
This commit is contained in:
Artur Beljajev 2019-03-28 22:08:16 +02:00
parent 296442e330
commit 487613db1e
14 changed files with 424 additions and 84 deletions

View file

@ -0,0 +1,14 @@
namespace :contacts do
desc 'Archives inactive contacts'
task archive: :environment do
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