Method: MongoMapper::Plugins::Persistence::ClassMethods#connection

Defined in:
lib/mongo_mapper/plugins/persistence.rb

#connection(mongo_connection = nil) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/mongo_mapper/plugins/persistence.rb', line 8

def connection(mongo_connection=nil)
  not_supported_by_embedded
  if mongo_connection.nil?
    @connection ||= MongoMapper.connection
  else
    @connection = mongo_connection
  end
  @connection
end