プロジェクト

全般

プロフィール

Vote #75229

完了

Count users with a single query on group list

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Code cleanup/refactoring_30
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
30
version_id:
81
issue_org_id:
16905
author_id:
36999
assigned_to_id:
1
comments:
6
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

All users are loaded for each group, only to count them !


journals

Here is the patch
--------------------------------------------------------------------------------
This patch didn't work for me, as the hash keys are strings (tested with postgresql):

<pre>
irb(main):001:0> User.joins(:groups).group('group_id').count
=> {"98913"=>2}
</pre>

Fix committed in r13149 with test.
--------------------------------------------------------------------------------
Jean-Philippe, thanks to have reviewed this patch.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Hi, you can indicate in the Resolution that's it's *Fixed*, if you have the time to, thanks a lot.
--------------------------------------------------------------------------------
Jérôme BATAILLE wrote:
> Hi, you can indicate in the Resolution that's it's *Fixed*, if you have the time to, thanks a lot.

"patch" tracker does not have "resolution" filed.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリCode cleanup/refactoring_30 にセット
  • 対象バージョン2.6.0_81 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0