From d7f3a21addaf53da05a07759e3ab2864bc00c973 Mon Sep 17 00:00:00 2001 From: yystopf Date: Fri, 23 Sep 2022 17:56:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=91=A8=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E6=8D=AE=E9=9C=80=E5=8A=A0=E5=85=A5=E5=B9=B4?= =?UTF-8?q?=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/timeable_visit_record.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/timeable_visit_record.rb b/app/models/timeable_visit_record.rb index 974e785e7..8411ddf66 100644 --- a/app/models/timeable_visit_record.rb +++ b/app/models/timeable_visit_record.rb @@ -20,7 +20,7 @@ class TimeableVisitRecord < ApplicationRecord belongs_to :project def self.build(project_id) - week = TimeableVisitRecord.find_or_create_by!(time: Date.today.cweek, project_id: project_id) + week = TimeableVisitRecord.find_or_create_by!(time: Date.today.strftime("%Y-%W"), project_id: project_id) month = TimeableVisitRecord.find_or_create_by!(time: Date.today.strftime("%Y%m"), project_id: project_id) return week, month