Class: ActiveTracker::QueriesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/active_tracker/queries_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
6
7
8
9
10
# File 'app/controllers/active_tracker/queries_controller.rb', line 3

def index
  ts = Time.current.to_f
  @queries = ActiveTracker::Model.all("Query")
  filter_queries if params[:q].present?
  duration = (Time.current.to_f - ts) * 1000
  @queries, @pagination = ActiveTracker::Model.paginate(@queries, params[:page], ActiveTracker::Configuration.per_page)
  @duration = duration
end

#showObject



12
13
14
15
# File 'app/controllers/active_tracker/queries_controller.rb', line 12

def show
  @query = ActiveTracker::Model.find(params[:id])
  @requests = @query.at_requests.map {|id| ActiveTracker::Model.find(id) rescue nil}.compact
end