]> source.dussan.org Git - redmine.git/commitdiff
Rails3: replace deprecated 'validate' method at IssueRelation model.
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 1 Sep 2011 00:43:42 +0000 (00:43 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 1 Sep 2011 00:43:42 +0000 (00:43 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6937 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue_relation.rb

index b4cb220bc828b409ef4f3b1255b2db6909016aa5..cc67b059ed42e2008c69ef8d6269d9d12c1e6de9 100644 (file)
@@ -41,6 +41,8 @@ class IssueRelation < ActiveRecord::Base
   validates_numericality_of :delay, :allow_nil => true
   validates_uniqueness_of :issue_to_id, :scope => :issue_from_id
 
+  validate :validate_issue_relation
+
   attr_protected :issue_from_id, :issue_to_id
 
   def visible?(user=User.current)
@@ -61,7 +63,7 @@ class IssueRelation < ActiveRecord::Base
     end
   end
 
-  def validate
+  def validate_issue_relation
     if issue_from && issue_to
       errors.add :issue_to_id, :invalid if issue_from_id == issue_to_id
       errors.add :issue_to_id, :not_same_project unless issue_from.project_id == issue_to.project_id || Setting.cross_project_issue_relations?