Sha256: 61b191be2c1dfd4d194cc064f5c9f3025ca6e4858e36dc66f9b22bfaa5114523
Contents?: true
Size: 496 Bytes
Versions: 2
Compression:
Stored size: 496 Bytes
Contents
module Apartment module Elevators # Provides a rack based db switching solution based on domain # Assumes that database name should match domain # Parses request host for second level domain # eg. example.com => example # www.example.bc.ca => example # class Domain < Generic def parse_database_name(request) return nil if request.host.blank? request.host.match(/(www\.)?(?<sld>[^.]*)/)["sld"] end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
apartment-0.22.1 | lib/apartment/elevators/domain.rb |
apartment-0.22.0 | lib/apartment/elevators/domain.rb |