Registry / database / apartment

apartment

JSON →
library2.2.1rbrubygemsunverified

Apartment allows Rack applications to deal with database multitenancy through ActiveRecord.

gem install apartment
INSTALL
IMPORT
SIG · APARTMENT
A
apartment
databaserubyv2.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Apartment
require 'apartment'

Switch database context to a specific tenant.

require 'apartment' # Switch to a tenant database Apartment::Tenant.switch!('tenant_name') do # All queries here go to the tenant's database User.all end
Debug
Known issues
breakingApartment 2.x requires ActiveRecord >= 4.2 and may have breaking changes from 1.x
fix
Check the upgrade guide and ensure your ActiveRecord version is compatible.
affects: >= 2.0.0
Upgrade
Version history
2.2.1latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
16
Amazon
1
OpenAI (training)
1
Resources
apartment — gem install apartment · libregistry