rails-antipattern-fat-model-god-object
Installation
SKILL.md
Antipattern: Fat Model / God Object
The smell
- One model owning many unrelated responsibilities (auth + billing + search + notifications + exports)
- Hundreds-to-thousands of lines, constants and scopes sprawling
- Every PR touches it; merge conflicts cluster on it
Why it hurts
- Cognitive load — readers can't tell what the model is
- Tests slow because every test loads every concern's deps
- Encourages "just add it to User" forever
The fix (in order of preference)
- Concerns in
app/models/concerns/for behavior that genuinely belongs to the model but is logically grouped (User::Authenticatable,User::Billable) - Value objects / POROs for cohesive logic operating on data (
PasswordStrength,SubscriptionStatus) - A new Active Record model when the "concern" is actually a missing entity (
AccountClosure) - Background jobs for side effects
Avoid app/services/UserService as the dumping ground — see service-object-soup.