Methods
Constants
NON_DELEGATE_METHODS = %w(nil? send object_id class extend find size count sum average maximum minimum paginate first last empty? any? respond_to?).to_set
Attributes
[R] current_scoped_methods_when_defined
[R] proxy_options
[R] proxy_scope
Public Class methods
new(proxy_scope, options, &block)
     # File activerecord/lib/active_record/named_scope.rb, line 119
119:       def initialize(proxy_scope, options, &block)
120:         options ||= {}
121:         [options[:extend]].flatten.each { |extension| extend extension } if options[:extend]
122:         extend Module.new(&block) if block_given?
123:         unless (Scope === proxy_scope || ActiveRecord::Associations::AssociationCollection === proxy_scope)
124:           @current_scoped_methods_when_defined = proxy_scope.send(:current_scoped_methods)
125:         end
126:         @proxy_scope, @proxy_options = proxy_scope, options.except(:extend)
127:       end
Public Instance methods
any?() {|*block_args| ...}
     # File activerecord/lib/active_record/named_scope.rb, line 161
161:       def any?
162:         if block_given?
163:           proxy_found.any? { |*block_args| yield(*block_args) }
164:         else
165:           !empty?
166:         end
167:       end
empty?()
     # File activerecord/lib/active_record/named_scope.rb, line 153
153:       def empty?
154:         @found ? @found.empty? : count.zero?
155:       end
first(*args)
     # File activerecord/lib/active_record/named_scope.rb, line 133
133:       def first(*args)
134:         if args.first.kind_of?(Integer) || (@found && !args.first.kind_of?(Hash))
135:           proxy_found.first(*args)
136:         else
137:           find(:first, *args)
138:         end
139:       end
last(*args)
     # File activerecord/lib/active_record/named_scope.rb, line 141
141:       def last(*args)
142:         if args.first.kind_of?(Integer) || (@found && !args.first.kind_of?(Hash))
143:           proxy_found.last(*args)
144:         else
145:           find(:last, *args)
146:         end
147:       end
reload()
     # File activerecord/lib/active_record/named_scope.rb, line 129
129:       def reload
130:         load_found; self
131:       end
respond_to?(method, include_private = false)
     # File activerecord/lib/active_record/named_scope.rb, line 157
157:       def respond_to?(method, include_private = false)
158:         super || @proxy_scope.respond_to?(method, include_private)
159:       end
size()
     # File activerecord/lib/active_record/named_scope.rb, line 149
149:       def size
150:         @found ? @found.length : count
151:       end
Protected Instance methods
proxy_found()
     # File activerecord/lib/active_record/named_scope.rb, line 170
170:       def proxy_found
171:         @found || load_found
172:       end