Skip to content

Commit

Permalink
Fixed Criteria#count to delegate to cursor (instead of result array).
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeMonkeySteve committed Jul 1, 2011
1 parent d2a7568 commit f4a55fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/mongo_odm/criteria.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
module MongoODM

class Criteria
delegate :to_xml, :to_yaml, :to_json, :include?, :first, :length, :count, :collect, :map, :each, :all?, :include?, :to => :to_a
delegate :to_xml, :to_yaml, :to_json, :include?, :first, :length, :collect, :map, :each, :all?, :include?, :to => :to_a
delegate :count, :to => :to_cursor

def initialize(klass, selector = {}, opts = {})
@_klass = klass
Expand Down Expand Up @@ -65,4 +66,4 @@ def method_missing(method_name, *args, &block)

end

end
end

0 comments on commit f4a55fe

Please sign in to comment.