-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using domains in tenants #5007
Merged
Merged
Conversation
This file contains 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
javierm
force-pushed
the
tenant_domains
branch
from
October 9, 2022 00:55
35b86f7
to
5a3ae37
Compare
javierm
force-pushed
the
tenant_domains
branch
from
October 9, 2022 11:00
5a3ae37
to
02ef781
Compare
javierm
force-pushed
the
tenant_domains
branch
from
October 9, 2022 12:01
02ef781
to
4b58e89
Compare
javierm
force-pushed
the
tenant_domains
branch
from
October 10, 2022 21:28
4b58e89
to
15e67e2
Compare
javierm
force-pushed
the
multitenancy
branch
5 times, most recently
from
October 19, 2022 11:10
616f69a
to
1afdcb2
Compare
javierm
force-pushed
the
tenant_domains
branch
from
October 19, 2022 13:48
15e67e2
to
9fe9107
Compare
javierm
force-pushed
the
multitenancy
branch
11 times, most recently
from
October 25, 2022 13:52
a749cb4
to
4fc0c00
Compare
javierm
force-pushed
the
tenant_domains
branch
from
November 28, 2022 16:14
2b29c0b
to
eb456fb
Compare
javierm
force-pushed
the
tenant_variants
branch
3 times, most recently
from
November 29, 2022 13:01
893be3b
to
d579bcc
Compare
javierm
force-pushed
the
tenant_domains
branch
from
November 29, 2022 13:23
eb456fb
to
ba2eb6b
Compare
javierm
force-pushed
the
tenant_domains
branch
5 times, most recently
from
December 4, 2022 14:36
76f9aef
to
31b38c3
Compare
taitus
force-pushed
the
tenant_domains
branch
from
December 7, 2022 10:04
31b38c3
to
3c206dc
Compare
taitus
approved these changes
Dec 7, 2022
javierm
force-pushed
the
tenant_domains
branch
2 times, most recently
from
December 12, 2022 11:01
e2a4c9f
to
ad01f85
Compare
taitus
approved these changes
Dec 13, 2022
Creating a schema takes about 3-4 seconds on my machine, so omitting the callbacks makes tests much faster. To do so, we're using the `insert!` method added in Rails 6.0, which inserts a record without executing callbacks or validations. To make the tests look consistent, we're adding a FactoryBot strategy which uses `insert!` instead of `create!`. Note this strategy is useless in most cases because it doesn't work when models have translatable attributes or associations. However, IMHO it's worth it even if we only use it for tenants. We could also use `Tenant.insert!` instead, but then we would have to add all the mandatory attributes, and in this case the code is clearer if we only add the attributes we need for the test.
Some institutions using CONSUL have expressed interest in this feature since some of their tenants might already have their own domains. We've considered many options for the user interface to select whether we're using a subdomain or a domain, like having two separate fields, using a check box, ... In the end we've chosen radio buttons because they make it easier to follow a logical sequence: first you decide whether you're introducing a domain or subdomain, and then you enter it. We've also considered hiding this option and assuming "if it's got a dot, it's a domain". However, this wouldn't work with nested subdomains and it wouldn't work with domains which are simply machine names. Note that a group of radio buttons (or check boxes) is difficult to style when the text of the label might expand over more than one line (as is the case here on small screens); in this case, most solutions result in the second line of the label appearing immediately under the radio button, instead of being aligned with the first line of the label. That's why I've added a container for the input+label combination.
javierm
force-pushed
the
tenant_domains
branch
3 times, most recently
from
December 13, 2022 12:12
ad01f85
to
e1e16d2
Compare
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.
References
Objectives
Visual changes