Commit d865565a authored by maeda's avatar maeda

Use pluck(:id) instead of collect(&:id) (#26711).

Patch by jwjw yy.


git-svn-id: https://svn.redmine.org/redmine/trunk@17454 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent c0604fc6
......@@ -34,7 +34,7 @@ class VersionsController < ApplicationController
@trackers = @project.trackers.sorted.to_a
retrieve_selected_tracker_ids(@trackers, @trackers.select {|t| t.is_in_roadmap?})
@with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1')
project_ids = @with_subprojects ? @project.self_and_descendants.collect(&:id) : [@project.id]
project_ids = @with_subprojects ? @project.self_and_descendants.pluck(:id) : [@project.id]
@versions = @project.shared_versions.preload(:custom_values)
@versions += @project.rolled_up_versions.visible.preload(:custom_values) if @with_subprojects
......
......@@ -1383,7 +1383,7 @@ class Issue < ActiveRecord::Base
# Unassigns issues from versions that are no longer shared
# after +project+ was moved
def self.update_versions_from_hierarchy_change(project)
moved_project_ids = project.self_and_descendants.reload.collect(&:id)
moved_project_ids = project.self_and_descendants.reload.pluck(:id)
# Update issues of the moved projects and issues assigned to a version of a moved project
Issue.update_versions(
["#{Version.table_name}.project_id IN (?) OR #{Issue.table_name}.project_id IN (?)",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment