mongomatic 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongomatic/base.rb +2 -2
- data/test/test_meta_mongo.rb +6 -0
- metadata +3 -3
data/lib/mongomatic/base.rb
CHANGED
@@ -29,8 +29,8 @@ module Mongomatic
|
|
29
29
|
@collection ||= self.db.collection(self.collection_name)
|
30
30
|
end
|
31
31
|
|
32
|
-
def find(query={})
|
33
|
-
Mongomatic::Cursor.new(self, collection.find(query))
|
32
|
+
def find(query={}, opts={})
|
33
|
+
Mongomatic::Cursor.new(self, collection.find(query, opts))
|
34
34
|
end
|
35
35
|
|
36
36
|
def all
|
data/test/test_meta_mongo.rb
CHANGED
@@ -64,5 +64,11 @@ class TestMongomatic < Test::Unit::TestCase
|
|
64
64
|
assert_equal nil, cursor.next
|
65
65
|
cursor = Person.find().limit(1).skip(1)
|
66
66
|
assert_equal p2, cursor.next
|
67
|
+
|
68
|
+
cursor = Person.find().sort("name", Mongo::ASCENDING)
|
69
|
+
assert_equal p, cursor.next
|
70
|
+
|
71
|
+
cursor = Person.find().sort("name", Mongo::DESCENDING)
|
72
|
+
assert_equal p2, cursor.next
|
67
73
|
end
|
68
74
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ben Myles
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-07-
|
17
|
+
date: 2010-07-26 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|