Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-09 20:02:54 +01:00
Add wizard find method
Dieser Commit ist enthalten in:
Ursprung
1b83570ad3
Commit
bdc699d43f
2 geänderte Dateien mit 5 neuen und 1 gelöschten Zeilen
|
@ -1,7 +1,7 @@
|
|||
module Jobs
|
||||
class SetAfterTimeWizard < Jobs::Base
|
||||
def execute(args)
|
||||
if PluginStoreRow.exists?(plugin_name: 'custom_wizard', key: args[:wizard_id])
|
||||
if CustomWizard::Wizard.find(args[:wizard_id])
|
||||
user_ids = []
|
||||
User.human_users.each do |u|
|
||||
u.custom_fields['redirect_to_wizard'] = args[:wizard_id]
|
||||
|
|
|
@ -167,6 +167,10 @@ class CustomWizard::Wizard
|
|||
PluginStore.set('custom_wizard', wizard["id"], wizard)
|
||||
end
|
||||
|
||||
def self.find(wizard_id)
|
||||
PluginStoreRow.find_by(plugin_name: 'custom_wizard', key: wizard_id)
|
||||
end
|
||||
|
||||
def self.set_redirect(user, wizard_id, url)
|
||||
PluginStore.set("#{wizard_id.underscore}_submissions", user.id, [{ redirect_to: url }])
|
||||
end
|
||||
|
|
Laden …
In neuem Issue referenzieren