https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292014-05-16T14:17:25ZRedmineRedmine - Patch #16905: Count users with a single query on group listhttps://www.redmine.org/issues/16905?journal_id=563492014-05-16T14:17:25ZJérôme BATAILLE
<ul><li><strong>File</strong> <a href="/attachments/11631">RM_16905_groups_index_users_count_optim.diff</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/11631/RM_16905_groups_index_users_count_optim.diff">RM_16905_groups_index_users_count_optim.diff</a> added</li></ul><p>Here is the patch</p> Redmine - Patch #16905: Count users with a single query on group listhttps://www.redmine.org/issues/16905?journal_id=564692014-05-24T10:42:01ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Subject</strong> changed from <i>Admin : groups otpimization of users count</i> to <i>Count users with a single query on group list</i></li><li><strong>Category</strong> changed from <i>Groups</i> to <i>Code cleanup/refactoring</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Target version</strong> set to <i>2.6.0</i></li></ul><p>This patch didn't work for me, as the hash keys are strings (tested with postgresql):</p>
<pre>
irb(main):001:0> User.joins(:groups).group('group_id').count
=> {"98913"=>2}
</pre>
<p>Fix committed in <a class="changeset" title="Count users with a single query on group list (#16905)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/13149">r13149</a> with test.</p> Redmine - Patch #16905: Count users with a single query on group listhttps://www.redmine.org/issues/16905?journal_id=564742014-05-24T15:44:45ZJérôme BATAILLE
<ul></ul><p>Jean-Philippe, thanks to have reviewed this patch.</p> Redmine - Patch #16905: Count users with a single query on group listhttps://www.redmine.org/issues/16905?journal_id=586352014-09-13T11:13:19ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li></ul> Redmine - Patch #16905: Count users with a single query on group listhttps://www.redmine.org/issues/16905?journal_id=776392017-03-31T12:15:00ZJérôme BATAILLE
<ul></ul><p>Hi, you can indicate in the Resolution that's it's <strong>Fixed</strong>, if you have the time to, thanks a lot.</p> Redmine - Patch #16905: Count users with a single query on group listhttps://www.redmine.org/issues/16905?journal_id=782812017-04-29T21:54:25ZToshi MARUYAMA
<ul></ul><p>Jérôme BATAILLE wrote:</p>
<blockquote>
<p>Hi, you can indicate in the Resolution that's it's <strong>Fixed</strong>, if you have the time to, thanks a lot.</p>
</blockquote>
<p>"patch" tracker does not have "resolution" filed.</p>