summaryrefslogtreecommitdiffstats
path: root/app/models/issue_status.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/issue_status.rb')
-rw-r--r--app/models/issue_status.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/issue_status.rb b/app/models/issue_status.rb
index 3929c6774..62b2cb762 100644
--- a/app/models/issue_status.rb
+++ b/app/models/issue_status.rb
@@ -51,6 +51,12 @@ class IssueStatus < ActiveRecord::Base
:conditions => ["role_id=? and tracker_id=?", role.id, tracker.id]).collect{ |w| w.new_status }.compact if role && tracker
new_statuses ? new_statuses.sort{|x, y| x.position <=> y.position } : []
end
+
+ def new_status_allowed_to?(status, role, tracker)
+ status && role && tracker ?
+ !workflows.find(:first, :conditions => {:new_status_id => status.id, :role_id => role.id, :tracker_id => tracker.id}).nil? :
+ false
+ end
def to_s; name end