Mercurial > hg > soundsoftware-site
comparison app/models/issue_relation.rb @ 507:0c939c159af4 redmine-1.2
Update to Redmine 1.2.1 on 1.2-stable branch (Redmine SVN rev 6270)
author | Chris Cannam |
---|---|
date | Thu, 14 Jul 2011 10:32:19 +0100 |
parents | 8661b858af72 |
children | cbb26bc654de |
comparison
equal
deleted
inserted
replaced
441:cbce1fd3b1b7 | 507:0c939c159af4 |
---|---|
45 | 45 |
46 def validate | 46 def validate |
47 if issue_from && issue_to | 47 if issue_from && issue_to |
48 errors.add :issue_to_id, :invalid if issue_from_id == issue_to_id | 48 errors.add :issue_to_id, :invalid if issue_from_id == issue_to_id |
49 errors.add :issue_to_id, :not_same_project unless issue_from.project_id == issue_to.project_id || Setting.cross_project_issue_relations? | 49 errors.add :issue_to_id, :not_same_project unless issue_from.project_id == issue_to.project_id || Setting.cross_project_issue_relations? |
50 errors.add_to_base :circular_dependency if issue_to.all_dependent_issues.include? issue_from | 50 #detect circular dependencies depending wether the relation should be reversed |
51 if TYPES.has_key?(relation_type) && TYPES[relation_type][:reverse] | |
52 errors.add_to_base :circular_dependency if issue_from.all_dependent_issues.include? issue_to | |
53 else | |
54 errors.add_to_base :circular_dependency if issue_to.all_dependent_issues.include? issue_from | |
55 end | |
51 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) | 56 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) |
52 end | 57 end |
53 end | 58 end |
54 | 59 |
55 def other_issue(issue) | 60 def other_issue(issue) |