From 95a2cc529828152fe6243a2c04f767beb1907a27 Mon Sep 17 00:00:00 2001 From: artoscinote <85488244+artoscinote@users.noreply.github.com> Date: Wed, 1 Jun 2022 11:43:15 +0200 Subject: [PATCH] Fix counts for archived tasks [SCI-6881] (#4132) --- app/controllers/experiments_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/experiments_controller.rb b/app/controllers/experiments_controller.rb index bbf3be8a0..8c4c34238 100644 --- a/app/controllers/experiments_controller.rb +++ b/app/controllers/experiments_controller.rb @@ -262,8 +262,8 @@ class ExperimentsController < ApplicationController .left_outer_joins(:designated_users, :task_comments) .preload(:tags, outputs: :to) .preload(:my_module_status, :my_module_group, user_assignments: %i(user user_role)) - .select('COUNT(users.id) as designated_users_count') - .select('COUNT(comments.id) as task_comments_count') + .select('COUNT(DISTINCT users.id) as designated_users_count') + .select('COUNT(DISTINCT comments.id) as task_comments_count') .select('my_modules.*').group(:id) end