Skip to content

Commit

Permalink
Updating doco
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Jan 10, 2010
1 parent 23bb5d7 commit b208cf9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/mongoid/named_scopes.rb
Expand Up @@ -33,11 +33,18 @@ def #{name}(*args)
EOT
end

class CriteriaProxy
class CriteriaProxy #:nodoc
attr_accessor :conditions, :klass, :parent_scope

delegate :scopes, :to => :parent_scope

# Instantiate the new +CriteriaProxy+. If the conditions contains an
# extension, the proxy will extend from that module. If a block is given
# it will be extended as well.
#
# Example:
#
# <tt>CriteriaProxy.new(parent, :where => { :active => true })</tt>
def initialize(parent_scope, conditions, &block)
conditions ||= {}
[ conditions.delete(:extend) ].flatten.each do |extension|
Expand Down Expand Up @@ -79,8 +86,7 @@ def method_missing(method, *args, &block)

def load_found
@found = Criteria.new(klass)
@found.criteria(conditions)
@found
@found.criteria(conditions); @found
end
end
end
Expand Down

0 comments on commit b208cf9

Please sign in to comment.