https://www.redmine.org/
https://www.redmine.org/favicon.ico?1679302129
2017-08-17T03:49:12Z
Redmine
Redmine - Patch #26711: Use pluck instead of collect/map
https://www.redmine.org/issues/26711?journal_id=80680
2017-08-17T03:49:12Z
Toshi MARUYAMA
<ul><li><strong>Category</strong> set to <i>Code cleanup/refactoring</i></li><li><strong>Target version</strong> set to <i>4.1.0</i></li></ul>
Redmine - Patch #26711: Use pluck instead of collect/map
https://www.redmine.org/issues/26711?journal_id=80681
2017-08-17T03:49:48Z
Toshi MARUYAMA
<ul><li><strong>Tracker</strong> changed from <i>Defect</i> to <i>Patch</i></li></ul>
Redmine - Patch #26711: Use pluck instead of collect/map
https://www.redmine.org/issues/26711?journal_id=80682
2017-08-17T04:05:12Z
Go MAEDA
<ul></ul><pre><code class="diff syntaxhl"><span class="gh">Index: app/helpers/my_helper.rb
===================================================================
</span><span class="gd">--- app/helpers/my_helper.rb (revision 16952)
</span><span class="gi">+++ app/helpers/my_helper.rb (working copy)
</span><span class="p">@@ -78,7 +78,7 @@</span>
def render_calendar_block(block, settings)
calendar = Redmine::Helpers::Calendar.new(User.current.today, current_language, :week)
calendar.events = Issue.visible.
<span class="gd">- where(:project_id => User.current.projects.map(&:id)).
</span><span class="gi">+ where(:project_id => User.current.projects.pluck(:id)).
</span> where("(start_date>=? and start_date<=?) or (due_date>=? and due_date<=?)", calendar.startdt, calendar.enddt, calendar.startdt, calendar.enddt).
includes(:project, :tracker, :priority, :assigned_to).
references(:project, :tracker, :priority, :assigned_to).
<span class="p">@@ -139,7 +139,7 @@</span>
def render_news_block(block, settings)
news = News.visible.
<span class="gd">- where(:project_id => User.current.projects.map(&:id)).
</span><span class="gi">+ where(:project_id => User.current.projects.pluck(:id)).
</span> limit(10).
includes(:project, :author).
references(:project, :author).
</code></pre>
Redmine - Patch #26711: Use pluck instead of collect/map
https://www.redmine.org/issues/26711?journal_id=82281
2017-11-26T14:40:01Z
Go MAEDA
<ul><li><strong>Subject</strong> changed from <i>.map should be changed to .pluck</i> to <i>Use pluck instead of map in MyHelper</i></li><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Go MAEDA</i></li><li><strong>Target version</strong> changed from <i>4.1.0</i> to <i>4.0.0</i></li></ul><p>Commited in the trunk. Thank you for pointing it out.</p>
Redmine - Patch #26711: Use pluck instead of collect/map
https://www.redmine.org/issues/26711?journal_id=86359
2018-07-28T15:20:53Z
Go MAEDA
<ul><li><strong>Subject</strong> changed from <i>Use pluck instead of map in MyHelper</i> to <i>Use pluck instead of collect/map</i></li><li><strong>Category</strong> changed from <i>Code cleanup/refactoring</i> to <i>Performance</i></li></ul>
Redmine - Patch #26711: Use pluck instead of collect/map
https://www.redmine.org/issues/26711?journal_id=86361
2018-07-28T15:21:36Z
Go MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-3 status-5 priority-4 priority-default closed" href="/issues/26726">Patch #26726</a>: Use pluck(:id) instead of collect(&:id) </i> added</li></ul>