Skip to content
Extraits de code Groupes Projets
Valider 0eeb265f rédigé par echarp's avatar echarp
Parcourir les fichiers

The default current week is properly recalculated

parent 0d63f2bb
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -2,10 +2,12 @@
class DigestsController < ApplicationController
has_scope :moderated, default: nil, allow_blank: true
has_scope :region, :locality, :tag
has_scope :period, allow_blank: true,
type: :hash, using: [:year, :week],
default: { year: (Time.zone.today + 7.days).year,
week: (Time.zone.today + 7.days).cweek }
has_scope :period, allow_blank: true, type: :hash, using: [:year, :week],
default: (
lambda do
{ year: (Time.zone.today + 7.days).year,
week: (Time.zone.today + 7.days).cweek }
end)
before_action :set_week, if: -> { params[:period] }
before_action :set_events, only: [:show]
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter