Class: SirTracksAlot::Reports::ActivityReport
- Inherits:
-
SirTracksAlotReport
- Object
- Ruport::Controller
- Report
- SirTracksAlotReport
- SirTracksAlot::Reports::ActivityReport
- Defined in:
- lib/sir_tracks_alot/reports/activity_report.rb
Defined Under Namespace
Modules: Helpers Classes: HTML
Constant Summary collapse
- COLUMN_NAMES =
['actor', 'action', 'target', 'event']
- LIMIT =
10000
Instance Attribute Summary
Attributes inherited from SirTracksAlotReport
Attributes inherited from Report
Instance Method Summary collapse
Methods inherited from Report
Instance Method Details
#setup ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sir_tracks_alot/reports/activity_report.rb', line 10 def setup super .column_names ||= COLUMN_NAMES activities = Activity.recent({:owner => .owner}, :order => 'DESC', :limit => (.limit || LIMIT)) events = activities.collect{|a| [a.actor, a.action, a.target, a.last_event]}.reject{|a| a[2].nil?} table = Table(.column_names, :data => events) table.sort_rows_by!('event', :order => :descending) self.data = table end |