Sha256: c801ce6627845ce3969ef5b44342d7413fead2516eeff1bdde44a07876e180fd
Contents?: true
Size: 516 Bytes
Versions: 8
Compression:
Stored size: 516 Bytes
Contents
module ActsAsTenant module ControllerExtensions module Subdomain extend ActiveSupport::Concern included do cattr_accessor :tenant_class, :tenant_column, :subdomain_lookup before_action :find_tenant_by_subdomain end private def find_tenant_by_subdomain if (subdomain = request.subdomains.send(subdomain_lookup)) ActsAsTenant.current_tenant = tenant_class.where(tenant_column => subdomain.downcase).first end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems