lib/mongo_mapper/connection.rb in mongo_mapper-0.11.2 vs lib/mongo_mapper/connection.rb in mongo_mapper-0.12.0

- old
+ new

@@ -68,10 +68,14 @@ if env['options'].is_a? Hash options = env['options'].symbolize_keys.merge(options) end MongoMapper.connection = if env['hosts'] - Mongo::ReplSetConnection.new( *env['hosts'].push(options) ) + if env['hosts'].first.is_a?(String) + Mongo::ReplSetConnection.new( env['hosts'], options ) + else + Mongo::ReplSetConnection.new( *env['hosts'].push(options) ) + end else Mongo::Connection.new(env['host'], env['port'], options) end MongoMapper.database = env['database'] \ No newline at end of file