File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ git_source(:bc) { |repo| "https://github.com/basecamp/#{repo}" }
33ruby file : ".ruby-version"
44
55gem "rails" , github : "rails/rails" , branch : "main"
6- gem "active_record-tenanted" , bc : "active_record-tenanted" , branch : "fizzy-temporary"
6+ gem "active_record-tenanted" , bc : "active_record-tenanted" , branch : "fizzy-temporary-2 "
77
88# Assets & front end
99gem "importmap-rails"
Original file line number Diff line number Diff line change 11GIT
22 remote: https://github.com/basecamp/active_record-tenanted
3- revision: 8728b0ea622dfbc15dc27f9ec9086a12ef873430
4- branch: fizzy-temporary
3+ revision: dcb9ee57eebfa85ed5a521c40266a0caaecc4a58
4+ branch: fizzy-temporary-2
55 specs:
66 active_record-tenanted (0.1.0 )
77 activerecord (>= 8.1.alpha )
Original file line number Diff line number Diff line change 1- Rails . application . configure do |config |
2- # uuugh this resolver proc is so gross.
3- config . middleware . use ActiveRecord ::Tenanted ::TenantSelector , "ApplicationRecord" , -> ( request ) { request . subdomain . split ( "." ) . first }
1+ Rails . application . config . after_initialize do
2+ Rails . application . config . active_record_tenanted . tenant_resolver = -> ( request ) do
3+ # in production, we're using a two-level subdomain like "tenant.fizzy.37signals.com", but in
4+ # development and beta it's only a single-level subdomain.
5+ tld_length = request . domain == "37signals.com" ? 2 : 1
6+ request . subdomain ( tld_length )
7+ end
48end
59
610ActiveSupport . on_load ( :action_controller_base ) do
You can’t perform that action at this time.
0 commit comments