aboutsummaryrefslogtreecommitdiff
path: root/views/events_list.haml
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-12-04 11:55:24 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-12-04 11:55:24 +0000
commit43e9b5101fc290db2ea1c2a9c3bfc3e11aee0e32 (patch)
tree27813a2d32a2ae86c7cd479b9b4c885c0108c863 /views/events_list.haml
parent2c843719f0776baa28099d15a58768a6ddefa94f (diff)
Added "eager" loading when looking at event histories.
Diffstat (limited to 'views/events_list.haml')
-rw-r--r--views/events_list.haml4
1 files changed, 2 insertions, 2 deletions
diff --git a/views/events_list.haml b/views/events_list.haml
index ff56310..ed08d3a 100644
--- a/views/events_list.haml
+++ b/views/events_list.haml
@@ -11,8 +11,8 @@
%a{:href => "/events/calendar/#{@start.strftime("%Y-%m")}?"+request.query_string}
Calendar view
= partial('events_form')
-- if @events.length > 0
- = partial('history', :collection => @events)
+- if @events.count > 0
+ = partial('history', :collection => @events.collect{|e| e.history.cached_alerts << e.alert ; e }.collect{|e| e.history}.uniq.sort{|a,b| a.created_at <=> b.created_at})
- else
%p
%strong