Rails3: model: replace deprecated errors.add_to_base at validate_issue_relation of IssueRelation
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7616 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
3914a27155
commit
54d553b27f
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue