Class: ActiveRecordProfiler::ReportsController

Inherits:
ApplicationController show all
Includes:
ReportsHelper
Defined in:
app/controllers/active_record_profiler/reports_controller.rb

Instance Method Summary collapse

Methods included from ReportsHelper

#bar_value, #breakable_path, #location_description, #report_column_header_link

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/active_record_profiler/reports_controller.rb', line 5

def index
  @report_options = report_options(params)
  collector = ActiveRecordProfiler::Collector.new
  @totals = collector.aggregate(:prefix => @report_options[:date])
  @top_locations = collector.sorted_locations(@report_options[:sort], 
      @report_options[:max_rows])
  top_item = @totals[@top_locations.first]
  @max_bar_value = bar_value(@report_options[:sort], top_item)
end