mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
15 lines
359 B
Ruby
15 lines
359 B
Ruby
class InactiveContacts
|
|
attr_reader :contacts
|
|
|
|
def initialize(contacts = Contact.archivable)
|
|
@contacts = contacts
|
|
end
|
|
|
|
def archive(verified: false)
|
|
contacts.each do |contact|
|
|
puts "Archiving contact: id(#{contact.id}), code(#{contact.code})"
|
|
contact.archive(verified: verified)
|
|
yield contact if block_given?
|
|
end
|
|
end
|
|
end
|