diff --git a/Gemfile b/Gemfile index 91833adba..87a4a1367 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gem "stimulus-rails" gem "turbo-rails" # Deployment and drivers -gem "active_record-tenanted", bc: "active_record-tenanted", branch: "flavorjones/path-based-tenanting" +gem "active_record-tenanted", bc: "active_record-tenanted" gem "bootsnap", require: false gem "kamal", bc: "kamal", ref: "344e2d79", require: false gem "puma", ">= 5.0" diff --git a/Gemfile.lock b/Gemfile.lock index 6051dac71..f50947b55 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,8 +7,7 @@ GIT GIT remote: https://github.com/basecamp/active_record-tenanted - revision: 8e33088cdbd69ab7b4cf4100d4202a54aa97e4c0 - branch: flavorjones/path-based-tenanting + revision: 4e4c5b8d7d293780b5b00ef893b3226da5e1fe33 specs: active_record-tenanted (0.1.0) activerecord (>= 8.1.alpha) diff --git a/test/test_helper.rb b/test/test_helper.rb index 1fe5ac9a1..d68021462 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -42,6 +42,18 @@ module ActiveSupport end end +class ActionDispatch::IntegrationTest + setup do + integration_session.default_url_options[:script_name] = "/#{ApplicationRecord.current_tenant}" + end +end + +class ActionDispatch::SystemTestCase + setup do + self.default_url_options[:script_name] = "/#{ApplicationRecord.current_tenant}" + end +end + RubyLLM.configure do |config| config.openai_api_key ||= "DUMMY-TEST-KEY" # Run tests with VCR without having to configure OpenAI API key locally. end