Is there any reasonable way to inherit a named scope and modify it in Rails?
In the application on which I'm working, there are a great many models which have a scope named is_readable
. Many of these models inherit from a handful of base models. One of the subclasses needs to add some strictures to its is_readable
scope, and I want to avoid:
- giving the subclass' scope a new name because then the standard
is_readable
check could not be performed universally - copy-pasting the superclass' scope definition into the subclass because then any future changes to the superclass' scope would not appear in the subclass