]> source.dussan.org Git - redmine.git/commitdiff
Rails3: model: replace deprecated 'validate' method at Issue model
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Sep 2011 06:12:35 +0000 (06:12 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Wed, 21 Sep 2011 06:12:35 +0000 (06:12 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7429 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb

index aef3ddb310cf24d2d18f78d3e3db9cd9efa5e1ef..82e0e35ed439345fdee7a21ad8db19f35ff0e771 100644 (file)
@@ -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