Sha256: 55ecc4344e433bd7037e9b3e210602ba8ae807413b3016b8e18b5149b7addd4e

Contents?: true

Size: 562 Bytes

Versions: 4

Compression:

Stored size: 562 Bytes

Contents

module Effective
  module Resources
    module Tenants

      def tenant?
        defined?(::Tenant)
      end

      def tenant
        return unless tenant?
        return nil unless klass.present?
        return nil unless class_name.include?('::')

        name = class_name.split('::').first.downcase.to_sym
        name if Rails.application.config.tenants[name].present?
      end

      def tenant_engines_blacklist
        return [] unless tenant?
        Rails.application.config.tenants.map { |name, _| name.to_s.classify }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
effective_resources-1.9.9 app/models/effective/resources/tenants.rb
effective_resources-1.9.8 app/models/effective/resources/tenants.rb
effective_resources-1.9.7 app/models/effective/resources/tenants.rb
effective_resources-1.9.6 app/models/effective/resources/tenants.rb