Skip to content

Commit

Permalink
update hound comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yuenmichelle1 committed Oct 8, 2024
1 parent d9d5e39 commit 4ae1eee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/queries/count_classifications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spec/queries/count_classifications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 4ae1eee

Please sign in to comment.