summaryrefslogtreecommitdiffstats
path: root/app/controllers/context_menus_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/context_menus_controller.rb')
-rw-r--r--app/controllers/context_menus_controller.rb10
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