From b14ce95b07342a12cfe27a51899d9fdf89f1a5ae Mon Sep 17 00:00:00 2001 From: Osamu Takiya Date: Sun, 13 Jun 2021 13:18:25 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20DM=20=E3=81=AE=E6=9C=9F?= =?UTF-8?q?=E9=99=90=E3=82=92=201=E6=99=82=E9=96=93=20=E4=BC=B8=E3=81=B0?= =?UTF-8?q?=E3=81=97=E3=81=9F=20(#147)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/google_sheet_api/write_to_tallied_sheet.rb | 2 +- app/models/direct_message.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/lib/google_sheet_api/write_to_tallied_sheet.rb b/app/lib/google_sheet_api/write_to_tallied_sheet.rb index 16921b7..dad3653 100644 --- a/app/lib/google_sheet_api/write_to_tallied_sheet.rb +++ b/app/lib/google_sheet_api/write_to_tallied_sheet.rb @@ -71,7 +71,7 @@ def nagashikomi(category, tweets_or_dms, target_sheets) def filtered_direct_messaages DirectMessage - .valid_term_votes + .extend_valid_term_votes .to_gensosenkyo_main .order(messaged_at: :asc) .order(id_number: :asc) diff --git a/app/models/direct_message.rb b/app/models/direct_message.rb index b3d191d..809f186 100644 --- a/app/models/direct_message.rb +++ b/app/models/direct_message.rb @@ -23,6 +23,13 @@ def self.valid_term_votes where(messaged_at: begin_datetime..end_datetime) end + def self.extend_valid_term_votes + begin_datetime = Time.zone.parse('2021-06-11 21:00:00') + end_datetime = Time.zone.parse('2021-06-13 12:59:59') + + where(messaged_at: begin_datetime..end_datetime) + end + # gensosenkyo: 1471724029, # sub_gensosenkyo: 1388758231825018881 def self.from_gensosenkyo_main