hack: to handle tenantname.fizzy.37signals.com
Let's do the needful thing for now, and clean it up once the gem has exposed the tenant resolver as a config in a cleaner way.
This commit is contained in:
@@ -3,7 +3,7 @@ git_source(:bc) { |repo| "https://github.com/basecamp/#{repo}" }
|
||||
ruby file: ".ruby-version"
|
||||
|
||||
gem "rails", github: "rails/rails", branch: "main"
|
||||
gem "active_record-tenanted", bc: "active_record-tenanted"
|
||||
gem "active_record-tenanted", bc: "active_record-tenanted", branch: "fizzy-temporary"
|
||||
|
||||
# Assets & front end
|
||||
gem "importmap-rails"
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
GIT
|
||||
remote: https://github.com/basecamp/active_record-tenanted
|
||||
revision: ac50c284049388344ba2603eae114e34fcf6bce0
|
||||
revision: d33ed3f81084946b4dbbc1d482d0aa342bd84873
|
||||
branch: fizzy-temporary
|
||||
specs:
|
||||
active_record-tenanted (0.1.0)
|
||||
activerecord (>= 8.1.alpha)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
Rails.application.configure do |config|
|
||||
config.middleware.use ActiveRecord::Tenanted::TenantSelector, "ApplicationRecord", ->(request) { request.subdomain }
|
||||
# uuugh this resolver proc is so gross.
|
||||
config.middleware.use ActiveRecord::Tenanted::TenantSelector, "ApplicationRecord", ->(request) { request.subdomain.split(".").first }
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user