Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Renamed find_many to find_each.

  • Loading branch information...
commit a85df4f6efa40a4f86f39a0a94810db8effc9aee 1 parent 9aa4e11
@jnunemaker jnunemaker authored
Showing with 7 additions and 7 deletions.
  1. +3 −3 lib/plucky/query.rb
  2. +4 −4 test/plucky/test_query.rb
View
6 lib/plucky/query.rb
@@ -52,7 +52,7 @@ def paginate(opts={})
end
end
- def find_many(opts={})
+ def find_each(opts={})
query = clone.update(opts)
query.collection.find(query.criteria.to_hash, query.options.to_hash)
end
@@ -72,7 +72,7 @@ def find(*ids)
end
def all(opts={})
- find_many(opts).to_a
+ find_each(opts).to_a
end
def first(opts={})
@@ -89,7 +89,7 @@ def remove(opts={})
end
def count(opts={})
- find_many(opts).count
+ find_each(opts).count
end
def size
View
8 test/plucky/test_query.rb
@@ -57,19 +57,19 @@ class QueryTest < Test::Unit::TestCase
end
end
- context "#find_many" do
+ context "#find_each" do
should "return a cursor" do
- cursor = Query.new(@collection).find_many
+ cursor = Query.new(@collection).find_each
cursor.should be_instance_of(Mongo::Cursor)
end
should "work with and normalize criteria" do
- cursor = Query.new(@collection).find_many(:id.in => ['john'])
+ cursor = Query.new(@collection).find_each(:id.in => ['john'])
cursor.to_a.should == [@john]
end
should "work with and normalize options" do
- cursor = Query.new(@collection).find_many(:order => :name.asc)
+ cursor = Query.new(@collection).find_each(:order => :name.asc)
cursor.to_a.should == [@chris, @john, @steve]
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.