Make the 'duplicates of' relation asymmetric:

* closing a issue will close its duplicates
* closing a duplicate won't close the main issue

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1488 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-06-03 18:30:29 +00:00
parent 891a71ad47
commit 7042879811
3 changed files with 28 additions and 8 deletions
+2 -2
View File
@@ -225,9 +225,9 @@ class Issue < ActiveRecord::Base
dependencies
end
# Returns an array of the duplicate issues
# Returns an array of issues that duplicate this one
def duplicates
relations.select {|r| r.relation_type == IssueRelation::TYPE_DUPLICATES}.collect {|r| r.other_issue(self)}
relations_to.select {|r| r.relation_type == IssueRelation::TYPE_DUPLICATES}.collect {|r| r.issue_from}
end
# Returns the due date or the target due date if any