The default current week is properly recalculated
This commit is contained in:
parent
0d63f2bb57
commit
0eeb265fc3
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user