diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-09-21 06:12:35 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-09-21 06:12:35 +0000 |
commit | 97c7e84f4929bae6851f30d5436ffc67ffbe0b6b (patch) | |
tree | 15bcefc8ee8e0b430384d7e20a72a44c17a0d73d /app/models/issue.rb | |
parent | ca9c6bc25415fc5ad4f0a44daa4611ce143dfba6 (diff) | |
download | redmine-97c7e84f4929bae6851f30d5436ffc67ffbe0b6b.tar.gz redmine-97c7e84f4929bae6851f30d5436ffc67ffbe0b6b.zip |
Rails3: model: replace deprecated 'validate' method at Issue model
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7429 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index aef3ddb31..82e0e35ed 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -58,6 +58,7 @@ class Issue < ActiveRecord::Base validates_length_of :subject, :maximum => 255 validates_inclusion_of :done_ratio, :in => 0..100 validates_numericality_of :estimated_hours, :allow_nil => true + validate :validate_issue named_scope :visible, lambda {|*args| { :include => :project, :conditions => Issue.visible_condition(args.shift || User.current, *args) } } @@ -337,7 +338,7 @@ class Issue < ActiveRecord::Base Setting.issue_done_ratio == 'issue_field' end - def validate + def validate_issue if self.due_date.nil? && @attributes['due_date'] && !@attributes['due_date'].empty? errors.add :due_date, :not_a_date end |