Repository navigation
Add subdomain-based organization multitenancy - #23
Merged
Merged
Conversation
Introduce Organization and OrganizationMembership models with the active tenant resolved from the request subdomain (e.g. arlington.localhost) and exposed via Current.organization. Every page requires a resolved org via the SetCurrentOrganization concern; the apex renders a landing page listing the foundations, unknown subdomains 404, and non-members are bounced to the apex. Sign-up/in, confirmation, and password reset are scoped per subdomain: registration auto-creates a membership (atomically) and mails subdomain-scoped links, sign-in requires membership, and existing emails are pointed to sign in. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The CI system-test job runs `bin/rails test:system`, which errored with a LoadError because the repo had no test/system directory. Add the standard ApplicationSystemTestCase plus an apex landing smoke test. Capybara is pointed at the "localhost" hostname (not 127.0.0.1) so the tenant resolver treats the bare host as the apex rather than parsing IP octets as a subdomain. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds multi-tenancy where each tenant is a community foundation: new
OrganizationandOrganizationMembershipmodels, with the active tenant resolved from the request subdomain (e.g.arlington.localhost) and exposed viaCurrent.organization. Every page requires a resolved org via theSetCurrentOrganizationconcern — the apex renders a landing page listing the foundations, unknown subdomains 404, and signed-in non-members are bounced to the apex. Authentication is isolated per subdomain: sign-up auto-creates a membership atomically and mails subdomain-scoped confirmation/reset links, sign-in requires membership of the current org, and an existing email is pointed to sign in rather than shown a uniqueness error. Includes migrations, fixtures, model/controller tests, seeds, abin/setupseed step, andtld_length = 0config so*.localhostsubdomains resolve in dev/test. Also adds a.rubocop.ymlhouse-style override (no extra indent afterprivate), which reformatted a few existing files.🤖 Generated with Claude Code