Module: Engine2::MetaQuerySupport

Included in:
DecodeMeta, FormMeta, ListMeta, ViewMeta
Defined in:
lib/engine2/meta.rb

Instance Method Summary collapse

Instance Method Details

#get_queryObject

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_runObject



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



355
356
357
# File 'lib/engine2/meta.rb', line 355

def select *args, &blk
    assets[:model].select(*args, &blk).ensure_primary_key.setup! (@meta[:fields] = [])
end