Module: DataMapper::YS::MemoryRepository

Defined in:
lib/dm-ys/memory_repository.rb

Overview

MemoryRepository

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(model) ⇒ Object



7
8
9
10
11
12
# File 'lib/dm-ys/memory_repository.rb', line 7

def self.included(model)
  DataMapper.setup(:memory, "sqlite3::memory:") 
  model.send :include, self
  model.send :extend,  self
  super
end

Instance Method Details

#repository(name = nil) ⇒ Object

force repository



15
16
17
# File 'lib/dm-ys/memory_repository.rb', line 15

def repository(name = nil)
  DataMapper.repository(name || :memory)
end