0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00

Start step bugfix

Dieser Commit ist enthalten in:
Angus McLeod 2017-11-13 15:49:08 +08:00
Ursprung 75d4fcaab5
Commit c490523412

Datei anzeigen

@ -51,13 +51,14 @@ class CustomWizard::Wizard
end end
def start def start
if unfinished? if unfinished? && last_completed_step = ::UserHistory.where(
step_id = ::UserHistory.where(
acting_user_id: @user.id, acting_user_id: @user.id,
action: ::UserHistory.actions[:custom_wizard_step], action: ::UserHistory.actions[:custom_wizard_step],
context: @id, context: @id,
subject: @steps.map(&:id) subject: @steps.map(&:id)
).order("created_at").last.subject ).order("created_at").last
step_id = last_completed_step.subject
last_index = @steps.index { |s| s.id == step_id } last_index = @steps.index { |s| s.id == step_id }
@steps[last_index + 1] @steps[last_index + 1]
else else