1
0
Fork 0
discourse-custom-wizard-unl.../jobs/set_after_time_wizard.rb

16 Zeilen
479 B
Ruby

2017-11-01 05:21:14 +01:00
module Jobs
2017-11-01 10:50:03 +01:00
class SetAfterTimeWizard < Jobs::Base
2017-11-01 05:21:14 +01:00
def execute(args)
if PluginStoreRow.exists?(plugin_name: 'custom_wizard', key: args[:wizard_id])
user_ids = []
User.human_users.each do |u|
u.custom_fields['redirect_to_wizard'] = args[:wizard_id]
u.save_custom_fields(true)
user_ids.push(u.id)
end
MessageBus.publish "/redirect_to_wizard", args[:wizard_id], user_ids: user_ids
end
end
end
end