summaryrefslogtreecommitdiffstats
path: root/app/controllers/issues_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-09 20:06:36 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-02-09 20:06:36 +0000
commit8c38510ee5045447a0be063596c888a678521b7b (patch)
treed2114936eee4bba4cb5ed9163a26bb36c9bd700e /app/controllers/issues_controller.rb
parent8b3ed4175d6e9d09175c1bea6f01b03079918f80 (diff)
downloadredmine-8c38510ee5045447a0be063596c888a678521b7b.tar.gz
redmine-8c38510ee5045447a0be063596c888a678521b7b.zip
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
Diffstat (limited to 'app/controllers/issues_controller.rb')
-rw-r--r--app/controllers/issues_controller.rb10
1 files changed, 5 insertions, 5 deletions
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