-
Notifications
You must be signed in to change notification settings - Fork 463
Closed
Description
I noticed that the Subdomain elevator first parses the subdomains and then returns the first one in the list in https://github.com/influitive/apartment/blob/development/lib/apartment/elevators/subdomain.rb#L37.
Examples:
- "bar.foo.com" would be ["bar"] and "bar" would be the subdomain.
- "baz.bar.foo.com" would be ["baz", "bar"] and "baz" would be the subdomain.
Base on the FirstSubdomain elevator, this seems like exactly the same since the FirstSubdomain just splits on "." and returns the first item. Seeing that we always get first in Subdomain, should link 37 not be something line:
def subdomain(host)
subdomains(host).join('.')
endThis way, following our example
- "bar.foo.com" would be ["bar"] and "bar" would be the subdomain/schema name
- "baz.bar.foo.com" would be ["baz", "bar"] and "baz.bar" would be the subdomain/schema name
FirstDomain should continue to work because in both cases, we'd still get "bar" and "baz".
Not sure if I'm mis-reading Subdomain implementation.
Xosmond
Metadata
Metadata
Assignees
Labels
No labels