Quick optimisation

This commit is contained in:
echarp 2019-04-19 10:13:23 +02:00
parent 53368a7ebc
commit ab915b0c56

View File

@ -56,6 +56,7 @@ class Event < ApplicationRecord
where '? <= end_time and start_time <= ?',
start_date.to_date.beginning_of_month.beginning_of_week,
start_date.to_date.end_of_month.end_of_week.end_of_day
includes :tags
end)
scope :period, (lambda do |year, week|
start_date = Date.commercial(year.to_i, week.to_i)