Sha256: 6fc84618241f98bb9498a1e57a2deb6ba3fcbd95736037d2e229d4be61e9ce45
Contents?: true
Size: 454 Bytes
Versions: 14
Compression:
Stored size: 454 Bytes
Contents
require 'apartment/elevators/generic' Apartment.configure do |config| config.excluded_models = ['PandaPal::Organization', 'PandaPal::Session'] config.tenant_names = lambda { PandaPal::Organization.pluck(:name) } end Rails.application.config.middleware.use Apartment::Elevators::Generic, lambda { |request| if match = request.path.match(/\/(?:orgs|organizations)\/(\d+)/) PandaPal::Organization.find_by(id: match[1]).try(:name) end }
Version data entries
14 entries across 14 versions & 1 rubygems