mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 11:38:30 +02:00
Don't double check if contact can be archived when ran via Task
This commit is contained in:
parent
816102130b
commit
11fc484270
3 changed files with 7 additions and 5 deletions
|
@ -17,8 +17,10 @@ module Concerns
|
|||
inactive
|
||||
end
|
||||
|
||||
def archive
|
||||
raise 'Contact cannot be archived' unless archivable?(post: true)
|
||||
def archive(verified: false)
|
||||
unless verified
|
||||
raise 'Contact cannot be archived' unless archivable?(post: true)
|
||||
end
|
||||
|
||||
destroy!
|
||||
end
|
||||
|
|
|
@ -5,11 +5,11 @@ class InactiveContacts
|
|||
@contacts = contacts
|
||||
end
|
||||
|
||||
def archive
|
||||
def archive(verified: false)
|
||||
contacts.each do |contact|
|
||||
log("Archiving contact: id(#{contact.id}), code(#{contact.code})")
|
||||
|
||||
contact.archive
|
||||
contact.archive(verified: verified)
|
||||
yield contact if block_given?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue