37signals-active-record-tenanted

Implement separate-database multi-tenancy in Rails apps with ActiveRecord Tenanted.

1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/joshyorko/agent-skills --skill 37signals-active-record-tenanted
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 37signals-active-record-tenanted
Source: https://github.com/joshyorko/agent-skills/tree/main/plugins/rails-37signals-patterns/skills/37signals-active-record-tenanted
Command: npx skills add https://github.com/joshyorko/agent-skills --skill 37signals-active-record-tenanted

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Implements separate-database multi-tenancy with Active Record Tenanted using tenant-aware Rails conventions, resolver configuration, and safety guardrails. Use when adding activerecord-tenanted, isolating each tenant in its own database, or adapting 37signals-style Rails apps to database-per-tenant architecture.

Core Features & Use Cases

  • Tenant isolation via separate databases managed by a Tenanted base class.
  • Centralized tenant resolution with configurable guards and safe defaults.
  • Real-world use: multi-tenant SaaS apps needing strict data isolation per tenant.

Quick Start

Configure your Rails app to enable ActiveRecord Tenanted with the provided ApplicationRecord base and tenant resolver, then bootstrap tenants as needed and run migrations per-tenant.

Frequently Asked Questions about 37signals-active-record-tenanted

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I isolate tenants in separate databases in a Rails app?

You isolate tenants in separate databases by implementing Active Record Tenanted, which uses a Tenanted base class to manage per-tenant database connections and enforce strict data isolation.

What is database-per-tenant multi-tenancy in Rails?

Database-per-tenant multi-tenancy is an architecture where each tenant gets their own isolated database. In Rails, this is managed via a Tenanted base class and a centralized tenant resolver with safety guardrails.

How do I configure a tenant resolver for ActiveRecord multi-tenancy?

You configure a tenant resolver by setting up your ApplicationRecord base class to integrate ActiveRecord Tenanted, applying centralized tenant resolution with configurable guards and safe defaults.

Does database-per-tenant multi-tenancy require a specific Rails version?

Yes, implementing separate-database multi-tenancy with Active Record Tenanted requires Rails 8.2 and sqlite3 support to establish the necessary per-tenant database connections and guardrails.

When should I use separate-database multi-tenancy instead of other approaches?

Use separate-database multi-tenancy for feature areas requiring strict tenant isolation, such as multi-tenant SaaS apps, regulated data stores, and multi-tenant dashboards where data boundaries must be absolute.

How do I run migrations for each tenant in a database-per-tenant Rails setup?

You run migrations per-tenant by bootstrapping tenants as needed through the configured tenant resolver, ensuring each isolated database receives its required schema updates independently.