mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
parent
296442e330
commit
487613db1e
14 changed files with 424 additions and 84 deletions
14
lib/tasks/contacts/archive.rake
Normal file
14
lib/tasks/contacts/archive.rake
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue