Permalink
Browse files

Merge archSeer's mongo 1.8 changes, bump dependencies.

  • Loading branch information...
1 parent 8d1f3fd commit 875e9a306e535f21ce6f701c941d72c49a2387d5 @cheald cheald committed Dec 7, 2012
Showing with 8 additions and 5 deletions.
  1. +2 −1 Gemfile
  2. +4 −4 lib/mongo_mapper/connection.rb
  3. +1 −0 mongo_mapper.gemspec
  4. +1 −0 test/functional/test_dirty.rb
View
3 Gemfile 100644 → 100755
@@ -1,7 +1,8 @@
source :rubygems
gem 'rake'
-gem 'bson_ext', '~> 1.5'
+gem 'mongo', '~> 1.8'
+gem 'bson_ext', '~> 1.8'
gem 'multi_json', '~> 1.2.0'
group :test do
View
@@ -10,7 +10,7 @@ module Connection
# @api public
def connection
- @@connection ||= Mongo::MongoClient.new
+ @@connection ||= Mongo::Connection.new
@fcheung
fcheung Jan 22, 2013 Contributor

I'm confused - 8d1f3fd replaced Mongo::Connection with Mongo::MongoClient, and this commit swaps them back ?

@jnunemaker
jnunemaker Jan 22, 2013 Contributor

This is an old commit or something. Check master and you'll see they are in...
https://github.com/jnunemaker/mongomapper/blob/master/lib/mongo_mapper/connection.rb#L76-L84

@fcheung
fcheung Jan 22, 2013 Contributor

Right you are - sorry for the noise

end
# @api public
@@ -75,12 +75,12 @@ def connect(environment, options={})
MongoMapper.connection = if env['hosts']
if env['hosts'].first.is_a?(String)
- Mongo::MongoReplicaSetClient.new( env['hosts'], options )
+ Mongo::ReplSetConnection.new( env['hosts'], options )
else
- Mongo::MongoReplicaSetClient.new( *env['hosts'].push(options) )
+ Mongo::ReplSetConnection.new( *env['hosts'].push(options) )
end
else
- Mongo::MongoClient.new(env['host'], env['port'], options)
+ Mongo::Connection.new(env['host'], env['port'], options)
end
MongoMapper.database = env['database']
View
1 mongo_mapper.gemspec 100644 → 100755
@@ -16,4 +16,5 @@ Gem::Specification.new do |s|
s.add_dependency 'activemodel', '~> 3.0'
s.add_dependency 'activesupport', '~> 3.0'
s.add_dependency 'plucky', '~> 0.5.2'
+ s.add_dependency 'mongo', '>= 1.8.0'
end
@@ -244,6 +244,7 @@ def setup
changes = doc.changes
doc.save!
doc.previous_changes.should == changes
+ doc.previous_changes["a"].should == ["b", "c"]
end
should "not include attributes loaded from db" do

0 comments on commit 875e9a3

Please sign in to comment.