Module: Engine2::MetaQuerySupport
- Included in:
- DecodeMeta, FormMeta, ListMeta, ViewMeta
- Defined in:
- lib/engine2/meta.rb
Instance Method Summary collapse
- #find_record(handler, id) ⇒ Object
-
#get_query ⇒ Object
move to query ?.
- #post_run ⇒ Object
- #query(q, &blk) ⇒ Object
- #select(*args, &blk) ⇒ Object
Instance Method Details
#find_record(handler, id) ⇒ Object
355 356 357 |
# File 'lib/engine2/meta.rb', line 355 def find_record handler, id get_query[assets[:model].primary_keys_hash_qualified(split_keys(id))] end |
#get_query ⇒ Object
move to query ?
347 348 349 350 351 352 353 |
# File 'lib/engine2/meta.rb', line 347 def get_query # move to query ? if dynamic? @query || @static.get_query else @query end end |
#post_run ⇒ Object
342 343 344 345 |
# File 'lib/engine2/meta.rb', line 342 def post_run query select(*assets[:model].columns) unless @query super end |
#query(q, &blk) ⇒ Object
337 338 339 340 |
# File 'lib/engine2/meta.rb', line 337 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 |