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 @@
class InactiveContacts
attr_reader :contacts
def initialize(contacts = Contact.archivable)
@contacts = contacts
end
def archive
contacts.each do |contact|
contact.archive
yield contact if block_given?
end
end
end