Sha256: 6def05340ec3a2a97cd3a317274720cda15d5672b39bc49f1f32be2b73353db8

Contents?: true

Size: 464 Bytes

Versions: 9

Compression:

Stored size: 464 Bytes

Contents

require 'apartment/elevators/subdomain'

module Apartment
  module Elevators
    # 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
    class FirstSubdomain < Subdomain

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

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
ros-apartment-2.3.0 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.3.0.alpha2 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.3.0.alpha1 lib/apartment/elevators/first_subdomain.rb
apartment-2.2.1 lib/apartment/elevators/first_subdomain.rb
apartment-2.2.0 lib/apartment/elevators/first_subdomain.rb
apartment-2.1.0 lib/apartment/elevators/first_subdomain.rb
apartment-2.0.0 lib/apartment/elevators/first_subdomain.rb
apartment-1.2.0 lib/apartment/elevators/first_subdomain.rb
apartment-1.1.0 lib/apartment/elevators/first_subdomain.rb