From 4ae1eeecbdb5bfbb630c935f586f263889d5b672 Mon Sep 17 00:00:00 2001 From: yuenmichelle1 Date: Mon, 7 Oct 2024 23:27:06 -0500 Subject: [PATCH] update hound comments --- app/queries/count_classifications.rb | 4 ++-- spec/queries/count_classifications_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/queries/count_classifications.rb b/app/queries/count_classifications.rb index 5fe562b..b0e0f5b 100644 --- a/app/queries/count_classifications.rb +++ b/app/queries/count_classifications.rb @@ -57,7 +57,7 @@ def include_today_to_scoped(scoped_upto_yesterday, workflow_id, period) # we check if the current date is part of the period # if so, we add the count to the most recent period pulled from db # if not, we append as a new entry for the current period - if is_today_part_of_recent_period?(most_recent_date_from_scoped, period) + if today_part_of_recent_period?(most_recent_date_from_scoped, period) add_todays_counts_to_recent_period_counts(scoped_upto_yesterday, todays_classifications) else todays_classifications[0].period = start_of_current_period(period).to_time.utc @@ -80,7 +80,7 @@ def start_of_current_period(period) end end - def is_today_part_of_recent_period?(most_recent_date, period) + def today_part_of_recent_period?(most_recent_date, period) most_recent_date == start_of_current_period(period) end diff --git a/spec/queries/count_classifications_spec.rb b/spec/queries/count_classifications_spec.rb index 9023062..bdeba0b 100644 --- a/spec/queries/count_classifications_spec.rb +++ b/spec/queries/count_classifications_spec.rb @@ -167,7 +167,7 @@ context 'when current day is part of the most recently pulled period' do it 'adds the most recent period to the most recently pulled period counts' do - create(:classification_with_diff_workflow, classification_id: 1000, event_time: Date.new(2022,01,02)) + create(:classification_with_diff_workflow, classification_id: 1000, event_time: Date.new(2022, 1, 2)) expect(counts.length).to eq(1) expect(counts[0].count).to eq(2) expect(counts[0].period).to eq(Date.today.at_beginning_of_year) @@ -176,7 +176,7 @@ context 'when current day is not part of the most recently pulled period' do it 'appends a new entry to scoped from HourlyWorkflowCount query' do - create(:classification_with_diff_workflow, classification_id: 1000, event_time: Date.new(2021,01,02)) + create(:classification_with_diff_workflow, classification_id: 1000, event_time: Date.new(2021, 1, 2)) expect(counts.length).to eq(2) counts.each { |c| expect(c.count).to eq(1) } expect(counts[0].class).to be(ClassificationCounts::DailyWorkflowClassificationCount)