You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"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:
defsubdomain(host)subdomains(host).join('.')end
This 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.
The text was updated successfully, but these errors were encountered:
I didn't actually write the FirstSubdomain Elevator and to my knowledge it never did anything different than the subdomain one. While you're probably correct that the subdomain elevator should match on x number of subdomains depending on your configuration, it definitely doesn't currently do that and your change would very much be a breaking change for a lot of people, so pretty tough to pass off without a lot of grumbling.
These elevators are mainly for convenience. We've almost always found that people need to customize them to suit their own needs, hence the GenericElevator which let's you define your own parser block.
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:
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:This way, following our example
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.
The text was updated successfully, but these errors were encountered: