take a look at this article, it may be of some help for you.
this article basically explains various ways to utilize with_scope.
one of the methods addresses a very similar situation to yours,
however, it is done at the controller level rather than the model. it
still may be useful to you.