]> source.dussan.org Git - redmine.git/commitdiff
Rails3: model: replace deprecated errors.add_to_base at validate_issue_relation of...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 7 Oct 2011 23:53:49 +0000 (23:53 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 7 Oct 2011 23:53:49 +0000 (23:53 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7616 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue_relation.rb

index d359b1ddf3b5e25eeb87242f1be8b901c96d6c14..854e4255b1301446d67880f1d9cf40d9aa96ce11 100644 (file)
@@ -71,11 +71,11 @@ class IssueRelation < ActiveRecord::Base
       errors.add :issue_to_id, :not_same_project unless issue_from.project_id == issue_to.project_id || Setting.cross_project_issue_relations?
       #detect circular dependencies depending wether the relation should be reversed
       if TYPES.has_key?(relation_type) && TYPES[relation_type][:reverse]
-        errors.add_to_base :circular_dependency if issue_from.all_dependent_issues.include? issue_to
+        errors.add :base, :circular_dependency if issue_from.all_dependent_issues.include? issue_to
       else
-        errors.add_to_base :circular_dependency if issue_to.all_dependent_issues.include? issue_from
+        errors.add :base, :circular_dependency if issue_to.all_dependent_issues.include? issue_from
       end
-      errors.add_to_base :cant_link_an_issue_with_a_descendant if issue_from.is_descendant_of?(issue_to) || issue_from.is_ancestor_of?(issue_to)
+      errors.add :base, :cant_link_an_issue_with_a_descendant if issue_from.is_descendant_of?(issue_to) || issue_from.is_ancestor_of?(issue_to)
     end
   end