Skip to content

Commit

Permalink
use Mongo::Connection instead of deprecated Mongo::Mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Dirolf committed Aug 26, 2009
1 parent 110713d commit 5336f2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion init.rb
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Expand Up @@ -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)

0 comments on commit 5336f2a

Please sign in to comment.