February 2012

ActiveRecord default_scope is an Anti-Pattern

TL;DR Active Record’s default_scope should be renamed to something like always_prepend_scope to better describe what the method does. The Inspiration The other day, "default_scope" is an anti-pattern came across my twitter feed.  Having been burned by this issue I get the sentiment. The Problem with default_scope Let’s say I have a simple class like the… Read more ActiveRecord default_scope is an Anti-Pattern