hashrocket-mongomapper 0.3.13 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/mongomapper.rb +1 -1
- data/lib/mongomapper/document.rb +2 -2
- data/mongomapper.gemspec +1 -1
- data/test/unit/test_document.rb +2 -2
- data/test/unit/test_mongomapper.rb +2 -2
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.14
|
data/lib/mongomapper.rb
CHANGED
data/lib/mongomapper/document.rb
CHANGED
@@ -60,13 +60,13 @@ module MongoMapper
|
|
60
60
|
|
61
61
|
def find_by_id(id)
|
62
62
|
criteria = FinderOptions.to_mongo_criteria(:_id => id)
|
63
|
-
if doc = collection.
|
63
|
+
if doc = collection.find_one(criteria)
|
64
64
|
new(doc)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
68
|
def count(conditions={})
|
69
|
-
collection.
|
69
|
+
collection.find(FinderOptions.to_mongo_criteria(conditions)).count
|
70
70
|
end
|
71
71
|
|
72
72
|
def create(*docs)
|
data/mongomapper.gemspec
CHANGED
data/test/unit/test_document.rb
CHANGED
@@ -18,11 +18,11 @@ class DocumentTest < Test::Unit::TestCase
|
|
18
18
|
end
|
19
19
|
|
20
20
|
should "have a connection" do
|
21
|
-
@document.connection.should be_instance_of(XGen::Mongo::Driver::
|
21
|
+
@document.connection.should be_instance_of(XGen::Mongo::Driver::Connection)
|
22
22
|
end
|
23
23
|
|
24
24
|
should "allow setting different connection without affecting the default" do
|
25
|
-
conn = XGen::Mongo::Driver::
|
25
|
+
conn = XGen::Mongo::Driver::Connection.new
|
26
26
|
@document.connection conn
|
27
27
|
@document.connection.should == conn
|
28
28
|
@document.connection.should_not == MongoMapper.connection
|
@@ -4,14 +4,14 @@ class Address; end
|
|
4
4
|
|
5
5
|
class MongoMapperTest < Test::Unit::TestCase
|
6
6
|
should "be able to write and read connection" do
|
7
|
-
conn = XGen::Mongo::Driver::
|
7
|
+
conn = XGen::Mongo::Driver::Connection.new
|
8
8
|
MongoMapper.connection = conn
|
9
9
|
MongoMapper.connection.should == conn
|
10
10
|
end
|
11
11
|
|
12
12
|
should "default connection to new mongo ruby driver" do
|
13
13
|
MongoMapper.connection = nil
|
14
|
-
MongoMapper.connection.should be_instance_of(XGen::Mongo::Driver::
|
14
|
+
MongoMapper.connection.should be_instance_of(XGen::Mongo::Driver::Connection)
|
15
15
|
end
|
16
16
|
|
17
17
|
should "be able to write and read default database" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hashrocket-mongomapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- test/unit/test_validations.rb
|
136
136
|
has_rdoc: false
|
137
137
|
homepage: http://github.com/jnunemaker/mongomapper
|
138
|
+
licenses:
|
138
139
|
post_install_message:
|
139
140
|
rdoc_options:
|
140
141
|
- --charset=UTF-8
|
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
156
|
requirements: []
|
156
157
|
|
157
158
|
rubyforge_project: mongomapper
|
158
|
-
rubygems_version: 1.
|
159
|
+
rubygems_version: 1.3.5
|
159
160
|
signing_key:
|
160
161
|
specification_version: 3
|
161
162
|
summary: Awesome gem for modeling your domain and storing it in mongo
|