summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/issue.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 11db3f89d..84a3c8e3c 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -51,6 +51,9 @@ class Issue < ActiveRecord::Base
validates_inclusion_of :done_ratio, :in => 0..100
validates_numericality_of :estimated_hours, :allow_nil => true
+ named_scope :visible, lambda {|*args| { :include => :project,
+ :conditions => Project.allowed_to_condition(args.first || User.current, :view_issues) } }
+
def after_initialize
if new_record?
# set default values for new records only