From 9f117159a6fbba47bed286be5df3172b6b50b5c0 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Mon, 24 Nov 2025 15:44:17 -0500 Subject: [PATCH] Restore structured logging of `queenbee_id` and clean up some other small remaining "plan b" to-dos. --- config/initializers/tenanting/logging.rb | 11 +++++++---- lib/tasks/seed.rake | 12 ------------ test/test_helper.rb | 2 -- 3 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 lib/tasks/seed.rake diff --git a/config/initializers/tenanting/logging.rb b/config/initializers/tenanting/logging.rb index 08733395b4..a8b834f310 100644 --- a/config/initializers/tenanting/logging.rb +++ b/config/initializers/tenanting/logging.rb @@ -1,4 +1,7 @@ -# # TODO:PLANB: we should log account id -# ActiveSupport.on_load(:action_controller_base) do -# before_action { logger.struct tenant: ApplicationRecord.current_tenant } -# end +ActiveSupport.on_load(:action_controller_base) do + before_action do + if Current.account.present? + logger.try(:struct, account: { queenbee_id: Current.account.external_account_id }) + end + end +end diff --git a/lib/tasks/seed.rake b/lib/tasks/seed.rake deleted file mode 100644 index e6ae37ba6e..0000000000 --- a/lib/tasks/seed.rake +++ /dev/null @@ -1,12 +0,0 @@ -namespace :seed do - desc "Seed customer data for a specific account (e.g: rails seed:customer ARTENANT=1234)" - task :customer, [ :tenant_id ] => "db:tenant" do |t, args| - raise "TODO:PLANB: Need to re-implement this task for untenanted context" - # raise "Please provide a tenant ID: rails seed:customer ARTENANT=1234" unless ApplicationRecord.current_tenant - - # account = Account.sole - # Account::Seeder.new(account, User.active.first).seed! - - # puts "✓ Seeded account #{account.name} (tenant: #{account.id})" - end -end diff --git a/test/test_helper.rb b/test/test_helper.rb index d370c51aea..bad1fdb2a1 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -48,8 +48,6 @@ class TestCase include Turbo::Broadcastable::TestHelper setup do - # TODO:PLANB: this is hacky, we should sort through the `Current` dependencies and figure out - # how to set Current.user without needing both a session *and* an account Current.account = accounts("37s") end