mirror of
https://github.com/redmine/redmine.git
synced 2025-11-10 15:26:03 +01:00
Use pluck(:id) instead of collect(&:id) (#26711).
Patch by jwjw yy. git-svn-id: http://svn.redmine.org/redmine/trunk@17454 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -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 (?)",
|
||||
|
||||
Reference in New Issue
Block a user