Class: ActiveTracker::RequestsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- ActiveTracker::RequestsController
- Defined in:
- app/controllers/active_tracker/requests_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
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 |
#show ⇒ Object
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.[:at_queries]) rescue [] @queries = query_ids.map {|id| ActiveTracker::Model.find(id) rescue nil}.compact exception_ids = JSON.parse(@request.[:at_exceptions]) rescue [] @exceptions = exception_ids.map {|id| ActiveTracker::Model.find(id) rescue nil}.compact end |