aboutsummaryrefslogtreecommitdiff
path: root/views/_events_calendar_day.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_calendar_day.haml
parent2c843719f0776baa28099d15a58768a6ddefa94f (diff)
Added "eager" loading when looking at event histories.
Diffstat (limited to 'views/_events_calendar_day.haml')
-rw-r--r--views/_events_calendar_day.haml2
1 files changed, 1 insertions, 1 deletions
diff --git a/views/_events_calendar_day.haml b/views/_events_calendar_day.haml
index 712559c..5aee31c 100644
--- a/views/_events_calendar_day.haml
+++ b/views/_events_calendar_day.haml
@@ -2,7 +2,7 @@
%p.event_date
%a{:href => "/events/list/#{@today.strftime("%F")}?#{request.query_string}"}
= @today.strftime((@today.day == 1) ? "%d %b" : "%d")
- =partial("history", :collection => events_calendar_day.last(10).alerts.to_a.reverse)
+ =partial("history", :collection => events_calendar_day.first(10).collect{|e| e.history.cached_alerts << e.alert ; e }.collect{|e| e.history}.uniq.sort{|a,b| a.created_at <=> b.created_at})
%p
- n_events = events_calendar_day.count
- if n_events > 10