Class: ActiveRecord::SqlMapper::StructExecStrategy
- Inherits:
-
ObjectExecStrategy
- Object
- ObjectExecStrategy
- ActiveRecord::SqlMapper::StructExecStrategy
- Defined in:
- lib/sql_mapper.rb
Instance Method Summary collapse
- #do_fetch ⇒ Object
-
#initialize(sql, result_class) ⇒ StructExecStrategy
constructor
A new instance of StructExecStrategy.
Methods inherited from ObjectExecStrategy
Constructor Details
#initialize(sql, result_class) ⇒ StructExecStrategy
Returns a new instance of StructExecStrategy.
79 80 81 |
# File 'lib/sql_mapper.rb', line 79 def initialize(sql, result_class) super(sql, result_class) end |
Instance Method Details
#do_fetch ⇒ Object
83 84 85 86 |
# File 'lib/sql_mapper.rb', line 83 def do_fetch @raw_results = ActiveRecord::Base.connection.exec_query(@sql) @result_class = create_struct_instance_from_col_names(@raw_results) end |