From 8c38510ee5045447a0be063596c888a678521b7b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 9 Feb 2012 20:06:36 +0000 Subject: Use #reduce instead of #inject for getting the intersection of arrays. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8827 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/issues_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/controllers/issues_controller.rb') diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index df130f9d5..4e3fe8aef 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -229,12 +229,12 @@ class IssuesController < ApplicationController end target_projects ||= @projects - @available_statuses = target_projects.map{|p|Workflow.available_statuses(p)}.inject{|memo,w|memo & w} - @custom_fields = target_projects.map{|p|p.all_issue_custom_fields}.inject{|memo,c|memo & c} - @assignables = target_projects.map(&:assignable_users).inject{|memo,a| memo & a} - @trackers = target_projects.map(&:trackers).inject{|memo,t| memo & t} + @available_statuses = target_projects.map{|p|Workflow.available_statuses(p)}.reduce(:&) + @custom_fields = target_projects.map{|p|p.all_issue_custom_fields}.reduce(:&) + @assignables = target_projects.map(&:assignable_users).reduce(:&) + @trackers = target_projects.map(&:trackers).reduce(:&) - @safe_attributes = @issues.map(&:safe_attribute_names).inject {|memo,attrs| memo & attrs} + @safe_attributes = @issues.map(&:safe_attribute_names).reduce(:&) render :layout => false if request.xhr? end -- cgit v1.2.3