Class: ActiveTracker::RequestsController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



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

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

#showObject



12
13
14
15
16
17
18
# File 'app/controllers/active_tracker/requests_controller.rb', line 12

def show
  @request = ActiveTracker::Model.find(params[:id])
  query_ids = JSON.parse(@request.tags[:at_queries]) rescue []
  @queries = query_ids.map {|id| ActiveTracker::Model.find(id) rescue nil}.compact
  exception_ids = JSON.parse(@request.tags[:at_exceptions]) rescue []
  @exceptions = exception_ids.map {|id| ActiveTracker::Model.find(id) rescue nil}.compact
end