Sha256: 392a407910fa1123da88771488cb0af86c111bb8dbbabfe16f67a45c92e6ae2a
Contents?: true
Size: 495 Bytes
Versions: 10
Compression:
Stored size: 495 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
10 entries across 10 versions & 1 rubygems