Refactor: use the existing Issue#new_statuses_allowed_to method.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3533 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
cdb86d5ef7
commit
976cba0c5d
2 files changed
+3
-2
No files matched your search
+2
-1
@@ -312,9 +312,10 @@ class Issue < ActiveRecord::Base
|
||||
end
|
||||
|
||||
# Returns an array of status that user is able to apply
|
||||
def new_statuses_allowed_to(user)
|
||||
def new_statuses_allowed_to(user, include_default=false)
|
||||
statuses = status.find_new_statuses_allowed_to(user.roles_for_project(project), tracker)
|
||||
statuses << status unless statuses.empty?
|
||||
statuses << IssueStatus.default if include_default
|
||||
statuses = statuses.uniq.sort
|
||||
blocked? ? statuses.reject {|s| s.is_closed?} : statuses
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user