Class: Apartment::Elevators::FirstSubdomain

Inherits:
Subdomain show all
Defined in:
lib/apartment/elevators/first_subdomain.rb

Overview

Provides a rack based tenant switching solution based on the first subdomain of a given domain name. eg:

- example1.domain.com               => example1
- example2.something.domain.com     => example2

Instance Method Summary collapse

Methods inherited from Subdomain

excluded_subdomains, excluded_subdomains=

Methods inherited from Generic

#call, #deprecation_warning, #initialize, #parse_database_name, #parse_method

Constructor Details

This class inherits a constructor from Apartment::Elevators::Generic

Instance Method Details

#parse_tenant_name(request) ⇒ Object


12
13
14
# File 'lib/apartment/elevators/first_subdomain.rb', line 12

def parse_tenant_name(request)
  super.split('.')[0]
end