Sha256: 936a3026f6b443597214a8816278f953d486de0c59ef3456d9595c98dde945de

Contents?: true

Size: 495 Bytes

Versions: 15

Compression:

Stored size: 495 Bytes

Contents

# frozen_string_literal: true

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

15 entries across 15 versions & 2 rubygems

Version Path
puzzle-apartment-2.12.0 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.11.0 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.10.0 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.9.0 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.8.1 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.8.1.rc2 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.8.1.rc1 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.8.0 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.7.2 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.7.1 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.7.0 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.6.1 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.6.0 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.5.0 lib/apartment/elevators/first_subdomain.rb
ros-apartment-2.4.0 lib/apartment/elevators/first_subdomain.rb