From 87d81e608b1519411558aab7410de7dcce6e11dd Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 28 Aug 2025 11:11:11 -0400 Subject: [PATCH] refactor: remove unused routes associated with "resource :account" - Drop from 313 unused routes to 306 unused routes - Use a namespace for the account-related resource routes - Controllers are nested under the "Account" module now - Move views from "accounts/" to "account/" --- .../entropy_configurations_controller.rb | 2 +- .../{accounts => account}/join_codes_controller.rb | 2 +- .../{accounts => account}/settings_controller.rb | 2 +- app/views/{accounts => account}/_invite.html.erb | 0 app/views/{accounts => account}/_user.html.erb | 0 .../settings/_entropy_configuration.html.erb | 0 .../{accounts => account}/settings/_users.html.erb | 4 ++-- .../{accounts => account}/settings/show.html.erb | 4 ++-- config/routes.rb | 11 ++++------- .../entropy_configurations_controller_test.rb | 2 +- test/controllers/accounts/settings_controller_test.rb | 2 +- test/routes_test.rb | 6 +++--- 12 files changed, 16 insertions(+), 19 deletions(-) rename app/controllers/{accounts => account}/entropy_configurations_controller.rb (81%) rename app/controllers/{accounts => account}/join_codes_controller.rb (78%) rename app/controllers/{accounts => account}/settings_controller.rb (55%) rename app/views/{accounts => account}/_invite.html.erb (100%) rename app/views/{accounts => account}/_user.html.erb (100%) rename app/views/{accounts => account}/settings/_entropy_configuration.html.erb (100%) rename app/views/{accounts => account}/settings/_users.html.erb (83%) rename app/views/{accounts => account}/settings/show.html.erb (80%) diff --git a/app/controllers/accounts/entropy_configurations_controller.rb b/app/controllers/account/entropy_configurations_controller.rb similarity index 81% rename from app/controllers/accounts/entropy_configurations_controller.rb rename to app/controllers/account/entropy_configurations_controller.rb index 07e828242..f3e1b7ebd 100644 --- a/app/controllers/accounts/entropy_configurations_controller.rb +++ b/app/controllers/account/entropy_configurations_controller.rb @@ -1,4 +1,4 @@ -class Accounts::EntropyConfigurationsController < ApplicationController +class Account::EntropyConfigurationsController < ApplicationController def update Entropy::Configuration.default.update!(entropy_configuration_params) diff --git a/app/controllers/accounts/join_codes_controller.rb b/app/controllers/account/join_codes_controller.rb similarity index 78% rename from app/controllers/accounts/join_codes_controller.rb rename to app/controllers/account/join_codes_controller.rb index b6f08bf3c..5c981a2ba 100644 --- a/app/controllers/accounts/join_codes_controller.rb +++ b/app/controllers/account/join_codes_controller.rb @@ -1,4 +1,4 @@ -class Accounts::JoinCodesController < ApplicationController +class Account::JoinCodesController < ApplicationController def show render svg: RQRCode::QRCode.new(join_url(Account.sole.join_code)).as_svg(viewbox: true, fill: :white, color: :black) end diff --git a/app/controllers/accounts/settings_controller.rb b/app/controllers/account/settings_controller.rb similarity index 55% rename from app/controllers/accounts/settings_controller.rb rename to app/controllers/account/settings_controller.rb index 60e60ceaf..2ad289342 100644 --- a/app/controllers/accounts/settings_controller.rb +++ b/app/controllers/account/settings_controller.rb @@ -1,4 +1,4 @@ -class Accounts::SettingsController < ApplicationController +class Account::SettingsController < ApplicationController def show @account = Account.sole @users = User.active diff --git a/app/views/accounts/_invite.html.erb b/app/views/account/_invite.html.erb similarity index 100% rename from app/views/accounts/_invite.html.erb rename to app/views/account/_invite.html.erb diff --git a/app/views/accounts/_user.html.erb b/app/views/account/_user.html.erb similarity index 100% rename from app/views/accounts/_user.html.erb rename to app/views/account/_user.html.erb diff --git a/app/views/accounts/settings/_entropy_configuration.html.erb b/app/views/account/settings/_entropy_configuration.html.erb similarity index 100% rename from app/views/accounts/settings/_entropy_configuration.html.erb rename to app/views/account/settings/_entropy_configuration.html.erb diff --git a/app/views/accounts/settings/_users.html.erb b/app/views/account/settings/_users.html.erb similarity index 83% rename from app/views/accounts/settings/_users.html.erb rename to app/views/account/settings/_users.html.erb index 6c834f0e6..cbcbaee50 100644 --- a/app/views/accounts/settings/_users.html.erb +++ b/app/views/account/settings/_users.html.erb @@ -5,13 +5,13 @@ navigable_list_actionable_items_value: true } do %>

People on the account

- <%#= render "accounts/invite" # Scheduled work in https://3.basecamp.com/2914079/buckets/37331921/todos/8746162337 %> + <%#= render "account/invite" # Scheduled work in https://3.basecamp.com/2914079/buckets/37331921/todos/8746162337 %>