Sha256: 2f4575d5d61a65027ada56781b9eb8a03901d9abaeb9b2d04216744617442a64

Contents?: true

Size: 403 Bytes

Versions: 3

Compression:

Stored size: 403 Bytes

Contents

module Apartment
  module Elevators
    # Provides a rack based db 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_database_name(request)
        super.split('.')[0]
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
apartment-0.22.1 lib/apartment/elevators/first_subdomain.rb
apartment-0.22.0 lib/apartment/elevators/first_subdomain.rb
apartment-0.21.1 lib/apartment/elevators/first_subdomain.rb