← Graph

Scope Concerns

concept 3 connections

Ivan Nemytchenko's 'dirty hack' for keeping models lean: scopes are shortcuts for fetching data sets, not domain logic, so move them into a dedicated concern and include it in the model. Rails still sees them inside the class, models stay clean, and the concern functions as a lightweight repository layer. What stays in the model: associations, business rules, state machines, defaults (and a few small methods like those used by null objects).

category
practice
about
Scope Concerns concept
Recommends moving model scopes into a concern so models stay lean.
recommends
Scope Concerns concept
Recommends moving scopes into a concern to keep models focused on domain logic.
concept Scope Concerns
related_to
Scope concerns keep scopes out of the domain model where they don't belong.

Provenance

Read by
4 extractions