Skip to content

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

Open
@artinboghosian

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions