Module: Engine2::MetaQuerySupport
- Included in:
- DecodeMeta, FormMeta, ListMeta, ViewMeta
- Defined in:
- lib/engine2/meta.rb
Instance Method Summary collapse
-
#get_query ⇒ Object
move to query ?.
- #post_run ⇒ Object
- #query(q, &blk) ⇒ Object
- #select(*args, &blk) ⇒ Object
Instance Method Details
#get_query ⇒ Object
move to query ?
351 352 353 354 355 356 357 |
# File 'lib/engine2/meta.rb', line 351 def get_query # move to query ? if dynamic? @query || @static.get_query else @query end end |
#post_run ⇒ Object
346 347 348 349 |
# File 'lib/engine2/meta.rb', line 346 def post_run query select(*assets[:model].columns) unless @query super end |
#query(q, &blk) ⇒ Object
341 342 343 344 |
# File 'lib/engine2/meta.rb', line 341 def query q, &blk @query = q.naked @query.row_proc = blk if blk end |
#select(*args, &blk) ⇒ Object
359 360 361 |
# File 'lib/engine2/meta.rb', line 359 def select *args, &blk assets[:model].select(*args, &blk).ensure_primary_key.setup! ([:fields] = []) end |