diff --git a/init.rb b/init.rb index cb3e2c6..278c94d 100644 --- a/init.rb +++ b/init.rb @@ -13,7 +13,7 @@ end require 'mongo_record/pk_factory' - $db = Mongo::Mongo.new(db_config['host'], db_config['port']).db(db_config['database'], :pk => MongoRecord::PKFactory.new) + $db = Mongo::Connection.new(db_config['host'], db_config['port']).db(db_config['database'], :pk => MongoRecord::PKFactory.new) # require this after the DB is set up, otherwise ActiveRecord::Base.connection.db does not # get populated require 'mongo_record' diff --git a/test/test_helper.rb b/test/test_helper.rb index 2b590ba..1678db5 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -7,5 +7,5 @@ # Tell Mongo adapter where to find schema file for testing. ENV['SCHEMA'] = File.join(File.dirname(__FILE__), 'schema.rb') -$mongo = Mongo::Mongo.new(ENV['MONGO_RUBY_DRIVER_HOST'], ENV['MONGO_RUBY_DRIVER_PORT']) +$mongo = Mongo::Connection.new(ENV['MONGO_RUBY_DRIVER_HOST'], ENV['MONGO_RUBY_DRIVER_PORT']) $db = $mongo.db('activerecord-mongo-adapter-test', :pk => MongoRecord::PKFactory.new)