Sha256: b35e8f8ac293fac57dafc2400aa9fc1a7ab60dab47afd769b655da97c33d4807

Contents?: true

Size: 446 Bytes

Versions: 14

Compression:

Stored size: 446 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]
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
apartment-1.0.2 lib/apartment/elevators/first_subdomain.rb
apartment-1.0.1 lib/apartment/elevators/first_subdomain.rb
apartment-1.0.0 lib/apartment/elevators/first_subdomain.rb
apartment-0.26.1 lib/apartment/elevators/first_subdomain.rb
apartment-0.26.0 lib/apartment/elevators/first_subdomain.rb
apartment-0.25.2 lib/apartment/elevators/first_subdomain.rb
apartment-0.25.1 lib/apartment/elevators/first_subdomain.rb
apartment-0.25.0 lib/apartment/elevators/first_subdomain.rb
apartment-0.24.3 lib/apartment/elevators/first_subdomain.rb
apartment-0.24.2 lib/apartment/elevators/first_subdomain.rb
apartment-0.24.1 lib/apartment/elevators/first_subdomain.rb
apartment-0.24.0 lib/apartment/elevators/first_subdomain.rb
apartment-0.23.2 lib/apartment/elevators/first_subdomain.rb
apartment-0.23.1 lib/apartment/elevators/first_subdomain.rb