# Default\_scope and scoped\_methods in 2.2.2?

**URL:** <https://www.ruby-forum.com/t/default-scope-and-scoped-methods-in-2-2-2/174566>\
**Category:** Rails\
**Created:** [August 28, 2009, 7:53pm UTC](https://www.ruby-forum.com/t/default-scope-and-scoped-methods-in-2-2-2/174566 "2009-08-28T19:53:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![throwern](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7c8e57/32.png) [@throwern](https://www.ruby-forum.com/u/throwern)\
**Post date:** [August 28, 2009, 7:53pm UTC](https://www.ruby-forum.com/t/default-scope-and-scoped-methods-in-2-2-2/174566/1 "2009-08-28T19:53:33Z")

</div>

I am running rails 2.2.2 and cannot upgrade to 2.3 at this time.

However, I would like to use a default\_scope and so I have installed  
the default\_scope plugin.  
This works great for standard AR classes but does not carry through  
Single Table Inheritance without adding the default\_scope declaration  
to every class. Not very DRY

I was hoping someone could shed some light on the following  
undocumented ActiveRecord method.

def scoped\_methods #:nodoc:  
Thread.current[:"#{self}\_scoped\_methods"] ||= []  
end

I am hoping I can make the following change without breaking anything.

def scoped\_methods #:nodoc:  
Thread.current[:"#{self.base\_class}\_scoped\_methods"] ||= []  
end
