    # File lib/active_record/named_scope.rb, line 85
          def named_scope(name, options = {}, &block)
            name = name.to_sym
            scopes[name] = lambda do |parent_scope, *args|
              Scope.new(parent_scope, case options
                when Hash
                  options
                when Proc
                  case parent_scope
                  when Scope
                    with_scope(:find => parent_scope.proxy_options) { options.call(*args) }
                  else
                    options.call(*args)
                  end
              end, &block)
            end
            (class << self; self end).instance_eval do
              define_method name do |*args|
                scopes[name].call(self, *args)
              end
            end
          end