0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 18:50:27 +01:00
discourse-custom-wizard/jobs/set_after_time_wizard.rb
Angus McLeod 5e5b5e67ee
FIX: Cache valid directs and only allow one type in a template (#176)
* Cache valid directs and only allow one type in a template

* Add spec

* Bump version

* Bump version

* Exclude current wizard from other_after_signup
2022-01-31 14:48:04 +05:30

24 Zeilen
631 B
Ruby

# frozen_string_literal: true
module Jobs
class SetAfterTimeWizard < ::Jobs::Base
def execute(args)
if SiteSetting.custom_wizard_enabled
wizard = CustomWizard::Wizard.create(args[:wizard_id])
if wizard && wizard.after_time
user_ids = []
User.human_users.each do |user|
if CustomWizard::Wizard.set_user_redirect(wizard.id, user)
user_ids.push(user.id)
end
end
CustomWizard::Template.clear_cache_keys
MessageBus.publish "/redirect_to_wizard", wizard.id, user_ids: user_ids
end
end
end
end
end