Leverage PostgreSQL count for study group size

This commit is contained in:
Sebastian Serth
2021-01-23 00:28:11 +01:00
parent 3b58cadbeb
commit 72b3524b18
3 changed files with 6 additions and 2 deletions

View File

@@ -25,7 +25,7 @@ h1 = StudyGroup.model_name.human(count: 2)
td
code = group.external_id
td = link_to_if(policy(group.consumer).show?, group.consumer, group.consumer)
td = group.users.count
td = group.user_count
td = link_to(t('shared.show'), group) if policy(group).show?
td = link_to(t('shared.edit'), edit_study_group_path(group)) if policy(group).edit?
td = link_to(t('shared.destroy'), group, data: {confirm: t('shared.confirm_destroy')}, method: :delete) if policy(group).destroy?