diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-09 19:51:38 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-09 19:51:38 +0000 |
commit | 8b3ed4175d6e9d09175c1bea6f01b03079918f80 (patch) | |
tree | 7dd0c1315d674bd4cce6cf7c4623e21c196110fb /app/controllers/context_menus_controller.rb | |
parent | 07a93c2731c5c68c0c64da3aeffc4ee1b19e1b5a (diff) | |
download | redmine-8b3ed4175d6e9d09175c1bea6f01b03079918f80.tar.gz redmine-8b3ed4175d6e9d09175c1bea6f01b03079918f80.zip |
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8826 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/context_menus_controller.rb')
-rw-r--r-- | app/controllers/context_menus_controller.rb | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/app/controllers/context_menus_controller.rb b/app/controllers/context_menus_controller.rb index 46eba1abf..fa7caf4e0 100644 --- a/app/controllers/context_menus_controller.rb +++ b/app/controllers/context_menus_controller.rb @@ -4,17 +4,11 @@ class ContextMenusController < ApplicationController def issues @issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project) - if (@issues.size == 1) @issue = @issues.first - @allowed_statuses = @issue.new_statuses_allowed_to(User.current) - else - @allowed_statuses = @issues.map do |i| - i.new_statuses_allowed_to(User.current) - end.inject do |memo,s| - memo & s - end end + + @allowed_statuses = @issues.map(&:new_statuses_allowed_to).inject{|memo,a| memo & a} @projects = @issues.collect(&:project).compact.uniq @project = @projects.first if @projects.size == 1 |