From bcd6c6dd660a941912eebdba17aab64a935c7856 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 7 Apr 2025 14:00:30 +0200 Subject: [PATCH] Move bubble stagings out from double nesting --- app/helpers/workflows_helper.rb | 2 +- config/routes.rb | 2 +- test/integration/bubble_messages.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/workflows_helper.rb b/app/helpers/workflows_helper.rb index 75cfd462a..f78241aa9 100644 --- a/app/helpers/workflows_helper.rb +++ b/app/helpers/workflows_helper.rb @@ -1,6 +1,6 @@ module WorkflowsHelper def button_to_set_stage(bubble, stage) - button_to bucket_bubble_stagings_path(bubble.bucket, bubble, stage_id: stage), + button_to bubble_stagings_path(bubble, stage_id: stage), method: :post, class: [ "btn full-width justify-start workflow-stage txt-uppercase", { "workflow-stage--current": stage == bubble.stage } ], form_class: "flex align-center gap-half", data: { turbo_frame: "_top" } do diff --git a/config/routes.rb b/config/routes.rb index 98606e7b4..11f46b500 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,6 +20,7 @@ Rails.application.routes.draw do resources :assignments resources :boosts + resources :stagings resources :taggings end end @@ -52,7 +53,6 @@ Rails.application.routes.draw do resource :readings, only: :create scope module: :bubbles do - resources :stagings end end end diff --git a/test/integration/bubble_messages.rb b/test/integration/bubble_messages.rb index 803d1e98f..dd9af9a04 100644 --- a/test/integration/bubble_messages.rb +++ b/test/integration/bubble_messages.rb @@ -34,14 +34,14 @@ class BubbleMessagesTest < ActionDispatch::IntegrationTest assert_equal "assigned", bubble.messages.last.messageable.events.last.action # Stage it - post bucket_bubble_stagings_url(buckets(:writebook), bubble), params: { stage_id: workflow_stages(:qa_triage).id } + post bubble_stagings_url(bubble), params: { stage_id: workflow_stages(:qa_triage).id } assert_equal 3, bubble.messages.count assert_predicate bubble.messages.last, :event_summary? assert_equal 2, bubble.messages.last.event_summary.events.count assert_equal "staged", bubble.messages.last.messageable.events.last.action # Unstage it - post bucket_bubble_stagings_url(buckets(:writebook), bubble), params: { stage_id: workflow_stages(:qa_triage).id } + post bubble_stagings_url(bubble), params: { stage_id: workflow_stages(:qa_triage).id } assert_equal 3, bubble.messages.count assert_predicate bubble.messages.last, :event_summary? assert_equal 3, bubble.messages.last.event_summary.events.count