Class: Ardm::ActiveRecord::Repository::Proxy
- Inherits:
-
Object
- Object
- Ardm::ActiveRecord::Repository::Proxy
- Defined in:
- lib/ardm/active_record/repository.rb
Instance Method Summary collapse
- #adapter ⇒ Object
-
#initialize(model) ⇒ Proxy
constructor
A new instance of Proxy.
- #select(*args) ⇒ Object
Constructor Details
#initialize(model) ⇒ Proxy
Returns a new instance of Proxy.
27 28 29 |
# File 'lib/ardm/active_record/repository.rb', line 27 def initialize(model) @model = model end |
Instance Method Details
#adapter ⇒ Object
31 32 33 |
# File 'lib/ardm/active_record/repository.rb', line 31 def adapter self end |
#select(*args) ⇒ Object
35 36 37 38 |
# File 'lib/ardm/active_record/repository.rb', line 35 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 |