rails-37-style-core-rails-models

Implement 37signals Rails model patterns with composable concerns and POROs.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/Chwistophe/agent-skills-unofficial-37-signals-rails-way-fizzy --skill rails-37-style-core-rails-models
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-37-style-core-rails-models
Source: https://github.com/Chwistophe/agent-skills-unofficial-37-signals-rails-way-fizzy/tree/main/rails-37-style-core-rails-models
Command: npx skills add https://github.com/Chwistophe/agent-skills-unofficial-37-signals-rails-way-fizzy --skill rails-37-style-core-rails-models

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a structured approach to building robust and maintainable Rails models, emphasizing clear separation of concerns, effective state management, and idiomatic Ruby patterns.

Core Features & Use Cases

  • Composable Concerns: Organize model behavior into reusable, self-contained modules.
  • State as Records: Manage discrete states (e.g., closed, golden) using dedicated database records for better tracking and querying.
  • PORO Patterns: Utilize Plain Old Ruby Objects for presentation logic, complex operations, and view context bundling.
  • Contextual Defaults: Employ default: -> {} for setting associations and attributes.
  • Request Context: Leverage ActiveSupport::CurrentAttributes for global request context.
  • Use Case: When designing a new feature for a task management application, use concerns to add functionalities like Assignable, Watchable, and Commentable to the Task model, ensuring each piece of behavior is isolated and testable.

Quick Start

Apply the Closeable concern to the Card model to manage its closed state.

Frequently Asked Questions about rails-37-style-core-rails-models

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

FAQPage Schema
How do I manage state in Rails models without using boolean columns?

Manage Rails model state by using dedicated database records instead of boolean flags. This approach provides better tracking and querying capabilities for discrete states like closed or golden within your application.

What is the best way to organize shared behavior across multiple Rails models?

Organize shared Rails model behavior using composable concerns. These self-contained modules isolate functionalities like Assignable or Commentable, ensuring each behavior remains independently testable and reusable across your application.

When should I use Plain Old Ruby Objects instead of ActiveRecord models in Rails?

Use Plain Old Ruby Objects (POROs) in Rails for presentation logic, complex operations, and view context bundling. POROs keep ActiveRecord models focused on data persistence rather than handling complex view-related or operational logic.

How do I set default associations and attributes contextually in Ruby on Rails?

Set contextual default associations and attributes in Ruby on Rails by employing lambda-based defaults using `default: -> {}`. Leverage `ActiveSupport::CurrentAttributes` to manage global request context like Current.user.

How should I name ActiveRecord scopes and handle validations in Rails models?

Apply semantic scope naming conventions and keep validations minimal in Rails models. This approach aligns with idiomatic Ruby patterns, ensuring robust model logic without unnecessary validation overhead.