From 15876b8762e7ff5e9a02e41fea1e64936f8b260e Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 18 Jul 2025 10:11:10 -0400 Subject: [PATCH] Update Signup to use the queenbee_id for the tenant name and not the subdomain. This change should have been in #665 --- app/models/signup.rb | 2 +- test/controllers/signup/accounts_controller_test.rb | 2 +- test/models/signup_test.rb | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/models/signup.rb b/app/models/signup.rb index e11ab3bfd..a02858cd6 100644 --- a/app/models/signup.rb +++ b/app/models/signup.rb @@ -55,7 +55,7 @@ class Signup end def tenant_name - @tenant_name ||= signal_account.subdomain + @tenant_name ||= @queenbee_account.id.to_s end def to_h diff --git a/test/controllers/signup/accounts_controller_test.rb b/test/controllers/signup/accounts_controller_test.rb index 78a1c1af5..413cf54c1 100644 --- a/test/controllers/signup/accounts_controller_test.rb +++ b/test/controllers/signup/accounts_controller_test.rb @@ -66,7 +66,7 @@ class Signup::AccountsControllerTest < ActionDispatch::IntegrationTest end signal_account = SignalId::Account.last - ApplicationRecord.with_tenant(signal_account.subdomain) do + ApplicationRecord.with_tenant(signal_account.queenbee_id) do assert_equal Account.last, signal_account.peer end end diff --git a/test/models/signup_test.rb b/test/models/signup_test.rb index fc9f89d7a..37d96bd6f 100644 --- a/test/models/signup_test.rb +++ b/test/models/signup_test.rb @@ -44,7 +44,8 @@ class SignupTest < ActiveSupport::TestCase assert @signup.user.persisted? assert_equal @signup.user.signal_user, @signup.signal_account.owner - assert_includes ApplicationRecord.tenants, @signup.signal_account.subdomain + assert_equal @signup.queenbee_account.id.to_s, @signup.tenant_name + assert_includes ApplicationRecord.tenants, @signup.tenant_name end test "the new account is named with company name if present" do @@ -87,7 +88,8 @@ class SignupTest < ActiveSupport::TestCase assert @signup.user.persisted? assert_equal @signup.user.signal_user, @signup.signal_account.owner - assert_includes ApplicationRecord.tenants, @signup.signal_account.subdomain + assert_equal @signup.queenbee_account.id.to_s, @signup.tenant_name + assert_includes ApplicationRecord.tenants, @signup.tenant_name end test "#process does nothing if a validation error occurs creating identity" do