Reduce SQL queries in the study groups controller
Fixes CODEOCEAN-Y7
This commit is contained in:
@ -19,7 +19,7 @@ class StudyGroup < ApplicationRecord
|
||||
end
|
||||
|
||||
def user_count
|
||||
study_group_memberships.distinct.count
|
||||
attributes['user_count'] || study_group_memberships.size
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
Reference in New Issue
Block a user