Skip to content

Commit

Permalink
update session time to be included with top contributors
Browse files Browse the repository at this point in the history
  • Loading branch information
yuenmichelle1 committed Aug 25, 2023
1 parent 63d5c03 commit 483cd9c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/queries/count_group_active_user_classifications.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def initial_scope(relation)
end

def select_clause
'user_id, SUM(classification_count)::integer AS count'
'user_id, SUM(classification_count)::integer AS count, SUM(total_session_time)::float AS session_time'
end

def relation(params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
describe 'select_clause' do
it 'selects user_id and orders users by count' do
counts = group_active_users_query.call(params)
expected_select_query = 'SELECT user_id, SUM(classification_count)::integer AS count FROM "daily_group_classification_count_and_time_per_user" '
expected_select_query = 'SELECT user_id, SUM(classification_count)::integer AS count, SUM(total_session_time)::float AS session_time FROM "daily_group_classification_count_and_time_per_user" '
expected_select_query += 'GROUP BY "daily_group_classification_count_and_time_per_user"."user_id" ORDER BY count DESC'
expect(counts.to_sql).to eq(expected_select_query)
end
Expand Down

0 comments on commit 483cd9c

Please sign in to comment.