This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2018-09-18 07:45:58 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class VerifyAccountLinksWorker
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
2022-11-08 23:24:21 -08:00
|
|
|
sidekiq_options queue: 'default', retry: false, lock: :until_executed
|
2018-09-18 07:45:58 -07:00
|
|
|
|
|
|
|
def perform(account_id)
|
|
|
|
account = Account.find(account_id)
|
|
|
|
|
|
|
|
account.fields.each do |field|
|
2022-11-08 23:24:21 -08:00
|
|
|
VerifyLinkService.new.call(field) if field.requires_verification?
|
2018-09-18 07:45:58 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
account.save! if account.changed?
|
|
|
|
rescue ActiveRecord::RecordNotFound
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|