vanilla-rails-models

Refactor Rails models to replace boolean flags with dedicated state records.

3|Updated Dec 25, 2025
One-click install
npx skills add https://github.com/ZempTime/zemptime-marketplace --skill vanilla-rails-models
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vanilla-rails-models
Source: https://github.com/ZempTime/zemptime-marketplace/tree/main/vanilla-rails/skills/models
Command: npx skills add https://github.com/ZempTime/zemptime-marketplace --skill vanilla-rails-models

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces a robust Rails modeling approach by replacing boolean state flags with dedicated state records, scoping capabilities as adjectives under the model, and guiding private method indentation for readability.

Core Features & Use Cases

  • State-as-Records: Capture who and when state changes occur by storing state in separate records (e.g., Star, Closure) rather than booleans.
  • Concerns as Adjectives: Namespace capabilities under the model (e.g., Card::Closeable) for clear ownership and extension.
  • Code Organization Guidelines: Recommend private method indentation, invocation-ordered methods, and thoughtful extraction when model logic grows.

Quick Start

Refactor a sample Rails model to replace a boolean state with a dedicated state record and move capabilities to namespaced adjectives under the model, e.g., Card::Closeable.

Frequently Asked Questions about vanilla-rails-models

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

FAQPage Schema
How do I refactor Rails models to replace boolean state flags with dedicated state records?

To refactor Rails models, replace boolean state flags with dedicated state records like Star or Closure. This state-as-records approach captures who and when state changes occur by storing state in separate has_one or has_many records rather than booleans.

What is the best way to namespace Rails concerns as adjectives under a model?

The best way to namespace Rails concerns is to define capabilities as adjective-named modules scoped directly under the model, such as Card::Closeable. This pattern ensures clear ownership and extension of scoped capabilities within the domain logic.

Why does replacing boolean flags with state records improve Rails domain logic?

Replacing boolean flags with state records improves Rails domain logic by capturing the full history of who and when state changes occur. Decomposing complex logic into separate state records provides clearer data tracking than simple true or false booleans.

Can I use namespaced concerns and state records in existing Rails apps with complex domain logic?

Yes, you can apply state records and namespaced concerns to existing Rails apps with complex domain logic. The approach decomposes monolithic models into has_one or has_many state records and adjective-named concerns without requiring external dependencies.

What are the guidelines for private method indentation and invocation ordering in Rails models?

Guidelines for private method indentation recommend structuring methods in invocation order and applying proper indentation for readability. This organization guides thoughtful extraction as Rails model logic grows, ensuring clear invocation sequencing within the codebase.