Sha256: e57699a3aa3efdd5cb584021b1a9be47f7de5b43cfe65525d398441031c771c2

Contents?: true

Size: 453 Bytes

Versions: 14

Compression:

Stored size: 453 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

Version Path
panda_pal-4.0.10 config/initializers/apartment.rb
panda_pal-4.0.8 config/initializers/apartment.rb
panda_pal-4.0.7 config/initializers/apartment.rb
panda_pal-4.0.6 config/initializers/apartment.rb
panda_pal-4.0.4 config/initializers/apartment.rb
panda_pal-4.0.3 config/initializers/apartment.rb
panda_pal-4.0.2 config/initializers/apartment.rb
panda_pal-4.0.1 config/initializers/apartment.rb
panda_pal-4.0.0 config/initializers/apartment.rb
panda_pal-3.2.3 config/initializers/apartment.rb
panda_pal-3.2.2 config/initializers/apartment.rb
panda_pal-3.2.1 config/initializers/apartment.rb
panda_pal-3.2.0 config/initializers/apartment.rb
panda_pal-3.1.4 config/initializers/apartment.rb