Petite optimisation

This commit is contained in:
echarp 2014-08-30 00:34:29 +02:00
parent ad3ca1eeb8
commit a31db00fc7

View File

@ -18,7 +18,7 @@
root_url(start_date: start_date), class: 'month_selector' } do |date, events|
.day_number= date.day
%ul.events
- events.select { |e| e.start_time.to_date <= date and date <= e.end_time.to_date }
- events.select { |e| (e.start_time.to_date..e.end_time.to_date).cover? date }
- .sort_by { |e| e.city }.each do |event|
%li.event
= link_to event do
@ -37,7 +37,7 @@
{ param => (date_range.last + 1.day).beginning_of_month, tag: params[:tag], region: params[:region] } } do |date, events|
.day_number= date.day
%ul.events
- events.select { |e| e.start_time.to_date <= date and date <= e.end_time.to_date }
- events.select { |e| (e.start_time.to_date..e.end_time.to_date).cover? date }
- .sort_by { |e| e.city }.each do |event|
%li.event
= link_to event do