Class: Ardm::ActiveRecord::Repository::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/ardm/active_record/repository.rb

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ Proxy

Returns a new instance of Proxy.



23
24
25
# File 'lib/ardm/active_record/repository.rb', line 23

def initialize(model)
  @model = model
end

Instance Method Details

#adapterObject



27
28
29
# File 'lib/ardm/active_record/repository.rb', line 27

def adapter
  self
end

#select(*args) ⇒ Object



31
32
33
34
# File 'lib/ardm/active_record/repository.rb', line 31

def select(*args)
  array_of_hashes = @model.connection.select_all(@model.send(:sanitize_sql_array, args))
  array_of_hashes.map { |h| Hashie::Mash.new(h) }
end