Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions app/controllers/inspect/scenarios_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ def process_scenario_save(scenario:, edit_path:, success_notice:, render_on_inva

apply_scenario_changes(
scenario,
success_path: inspect_scenario_path(id: scenario.id),
failure_path: edit_path,
success_notice: success_notice,
render_on_invalid: render_on_invalid
Expand All @@ -186,7 +185,7 @@ def assign_parsed_attributes(redirect_path)
end

# Applies scenario changes via updater and updates user sortables in a transaction
def apply_scenario_changes(scenario, success_path:, failure_path:, success_notice:, render_on_invalid:)
def apply_scenario_changes(scenario, failure_path:, success_notice:, render_on_invalid:)
updater_params = build_updater_params(params)
force_update = params[:force_update].present?
result = ::ScenarioUpdater.new(scenario, updater_params, current_user, skip_validation: force_update).call
Expand Down Expand Up @@ -214,7 +213,7 @@ def apply_scenario_changes(scenario, success_path:, failure_path:, success_notic
end

if success
redirect_to success_path, notice: success_notice
redirect_to inspect_scenario_path(id: scenario.id), notice: success_notice
else
# If there are validation errors and force_update wasn't used, render the form
if flash.now[:show_force_update]
Expand Down