Skip to content

Commit

Permalink
init first last step
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseude committed Dec 3, 2023
1 parent faa8c11 commit 280b4ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/wicked/wizard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,17 @@ def wizard_value(step_name)
@wicked_redirect_params = nil
end

private def check_first_last_step!(step)
return steps.first if step.to_s == Wicked::FIRST_STEP
return steps.last if step.to_s == Wicked::LAST_STEP
return step
end

private def setup_step_from(the_step)
return if steps.nil?

the_step ||= steps.first
the_step = check_first_last_step!(the_step)

valid_steps = steps + self.class::PROTECTED_STEPS
resolved_step = valid_steps.detect { |stp| stp.to_s == the_step }
Expand Down

0 comments on commit 280b4ac

Please sign in to comment.