Skip to content

Commit

Permalink
make steps url accessible same as journeys
Browse files Browse the repository at this point in the history
  • Loading branch information
celuchmarek committed Dec 10, 2024
1 parent 7575597 commit fd60024
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/steps_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class StepsController < ApplicationController
before_action :redirect_inactive_parliament_application, only: :show

def show
@journey = Journey.published.find_by!(slug: params[:journey_id])
@journey = Journey.accessible_by_url.find_by!(slug: params[:journey_id])
@steps = @journey.steps
@current_step = @steps.find_by!(slug: params[:id])
@user_step_from_step_map = {}
Expand All @@ -14,7 +14,7 @@ def show
end

def update
@journey = Journey.published.find_by!(slug: params[:journey_id])
@journey = Journey.accessible_by_url.find_by!(slug: params[:journey_id])
@user_journey = UserJourney.order(id: :desc).find_by(user: current_user, journey: @journey) || current_user.user_journeys.create!(journey: @journey)

@current_step = @journey.steps.find_by(slug: params[:id])
Expand All @@ -35,7 +35,7 @@ def update
end

def start
journey = Journey.published.find_by!(slug: params[:journey_id])
journey = Journey.accessible_by_url.find_by!(slug: params[:journey_id])
step = journey.steps.find_by!(slug: params[:id])

redirect_to step.app_url
Expand Down

0 comments on commit fd60024

Please sign in to comment.