Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

past_step? & future_step? do not consider wicked_finish in calculation #305

Open
artinboghosian opened this issue Apr 13, 2024 · 0 comments

Comments

@artinboghosian
Copy link

artinboghosian commented Apr 13, 2024

I have the following Wicked Controller (unnecessary code removed):

class OnboardingController < ApplicationController
  include Wicked::Wizard

  steps :intro, :register, :jobs, :confirmation

  before_action :skip_registration

  private

  def skip_registration
    return if past_step?(:register)
    
    jump_to(:jobs)
    render_wizard
  end

  def finish_wizard_path
    some_random_url
  end
end

The skip_registration method works properly until the Wizard executes the wicked_finish step. The reason is b/c past_step?(:register) returns false when the step name is wicked_finish. This seemed unexpected to me, but I don't want to presume. Is it intended behavior that past_step? should return false when step is wicked_finish? I haven't checked but I'm assuming future_step? would have the same issue with any of the internal step names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant