Quick optimisation

remotes/origin/master
echarp 4 years ago
parent 53368a7ebc
commit ab915b0c56
  1. 1
      app/models/event.rb

@ -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)

Loading…
Cancel
Save