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 CHANGED
@@ -1 +1 @@
1
- 0.3.13
1
+ 0.3.14
@@ -48,7 +48,7 @@ module MongoMapper
48
48
  end
49
49
 
50
50
  def self.connection
51
- @@connection ||= XGen::Mongo::Driver::Mongo.new
51
+ @@connection ||= XGen::Mongo::Driver::Connection.new
52
52
  end
53
53
 
54
54
  def self.connection=(new_connection)
@@ -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.find_first(criteria)
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.count(FinderOptions.to_mongo_criteria(conditions))
69
+ collection.find(FinderOptions.to_mongo_criteria(conditions)).count
70
70
  end
71
71
 
72
72
  def create(*docs)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mongomapper}
8
- s.version = "0.3.13"
8
+ s.version = "0.3.14"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["John Nunemaker"]
@@ -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::Mongo)
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::Mongo.new
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::Mongo.new
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::Mongo)
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.13
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.2.0
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