Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-25 18:50:27 +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
|
module Jobs
|
||||||
class SetAfterTimeWizard < Jobs::Base
|
class SetAfterTimeWizard < Jobs::Base
|
||||||
def execute(args)
|
def execute(args)
|
||||||
if PluginStoreRow.exists?(plugin_name: 'custom_wizard', key: args[:wizard_id])
|
if CustomWizard::Wizard.find(args[:wizard_id])
|
||||||
user_ids = []
|
user_ids = []
|
||||||
User.human_users.each do |u|
|
User.human_users.each do |u|
|
||||||
u.custom_fields['redirect_to_wizard'] = args[:wizard_id]
|
u.custom_fields['redirect_to_wizard'] = args[:wizard_id]
|
||||||
|
|
|
@ -167,6 +167,10 @@ class CustomWizard::Wizard
|
||||||
PluginStore.set('custom_wizard', wizard["id"], wizard)
|
PluginStore.set('custom_wizard', wizard["id"], wizard)
|
||||||
end
|
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)
|
def self.set_redirect(user, wizard_id, url)
|
||||||
PluginStore.set("#{wizard_id.underscore}_submissions", user.id, [{ redirect_to: url }])
|
PluginStore.set("#{wizard_id.underscore}_submissions", user.id, [{ redirect_to: url }])
|
||||||
end
|
end
|
||||||
|
|
Laden …
In neuem Issue referenzieren