Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge archSeer's mongo 1.8 changes, bump dependencies.
  • Loading branch information
cheald committed Dec 7, 2012
1 parent 8d1f3fd commit 875e9a3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Gemfile 100644 → 100755
@@ -1,7 +1,8 @@
source :rubygems source :rubygems


gem 'rake' gem 'rake'
gem 'bson_ext', '~> 1.5' gem 'mongo', '~> 1.8'
gem 'bson_ext', '~> 1.8'
gem 'multi_json', '~> 1.2.0' gem 'multi_json', '~> 1.2.0'


group :test do group :test do
Expand Down
8 changes: 4 additions & 4 deletions lib/mongo_mapper/connection.rb 100644 → 100755
Expand Up @@ -10,7 +10,7 @@ module Connection


# @api public # @api public
def connection def connection
@@connection ||= Mongo::MongoClient.new @@connection ||= Mongo::Connection.new

This comment has been minimized.

Copy link
@fcheung

fcheung Jan 22, 2013

Contributor

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

This comment has been minimized.

Copy link
@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

This comment has been minimized.

Copy link
@fcheung

fcheung Jan 22, 2013

Contributor

Right you are - sorry for the noise

end end


# @api public # @api public
Expand Down Expand Up @@ -75,12 +75,12 @@ def connect(environment, options={})


MongoMapper.connection = if env['hosts'] MongoMapper.connection = if env['hosts']
if env['hosts'].first.is_a?(String) if env['hosts'].first.is_a?(String)
Mongo::MongoReplicaSetClient.new( env['hosts'], options ) Mongo::ReplSetConnection.new( env['hosts'], options )
else else
Mongo::MongoReplicaSetClient.new( *env['hosts'].push(options) ) Mongo::ReplSetConnection.new( *env['hosts'].push(options) )
end end
else else
Mongo::MongoClient.new(env['host'], env['port'], options) Mongo::Connection.new(env['host'], env['port'], options)
end end


MongoMapper.database = env['database'] MongoMapper.database = env['database']
Expand Down
1 change: 1 addition & 0 deletions mongo_mapper.gemspec 100644 → 100755
Expand Up @@ -16,4 +16,5 @@ Gem::Specification.new do |s|
s.add_dependency 'activemodel', '~> 3.0' s.add_dependency 'activemodel', '~> 3.0'
s.add_dependency 'activesupport', '~> 3.0' s.add_dependency 'activesupport', '~> 3.0'
s.add_dependency 'plucky', '~> 0.5.2' s.add_dependency 'plucky', '~> 0.5.2'
s.add_dependency 'mongo', '>= 1.8.0'
end end
1 change: 1 addition & 0 deletions test/functional/test_dirty.rb
Expand Up @@ -244,6 +244,7 @@ def setup
changes = doc.changes changes = doc.changes
doc.save! doc.save!
doc.previous_changes.should == changes doc.previous_changes.should == changes
doc.previous_changes["a"].should == ["b", "c"]
end end


should "not include attributes loaded from db" do should "not include attributes loaded from db" do
Expand Down

0 comments on commit 875e9a3

Please sign in to comment.