Don't say is_a?(ActiveRecord::NamedScope::Scope)
because that is no longer true in Rails 3 and also doesn't match unscoped ActiveRecord classes themselves (which we consider scopes for all practical purposes).
A good way is to say this instead:
object.respond_to?(:scoped)
Posted by Henning Koch to makandra dev (2012-08-01 11:36)