diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-03 18:30:29 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-06-03 18:30:29 +0000 |
commit | 7042879811ab27fea45ea23a06b95eb8d70207b7 (patch) | |
tree | 52a11301794f9b5a617a76d65d66ad8bfb551a29 /app | |
parent | 891a71ad474812ce0108d84d649706dc64336c90 (diff) | |
download | redmine-7042879811ab27fea45ea23a06b95eb8d70207b7.tar.gz redmine-7042879811ab27fea45ea23a06b95eb8d70207b7.zip |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/models/issue.rb | 4 | ||||
-rw-r--r-- | app/models/issue_relation.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 633253db7..d83b2ab02 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -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 diff --git a/app/models/issue_relation.rb b/app/models/issue_relation.rb index 07e940b85..49329e0bb 100644 --- a/app/models/issue_relation.rb +++ b/app/models/issue_relation.rb @@ -25,7 +25,7 @@ class IssueRelation < ActiveRecord::Base TYPE_PRECEDES = "precedes" TYPES = { TYPE_RELATES => { :name => :label_relates_to, :sym_name => :label_relates_to, :order => 1 }, - TYPE_DUPLICATES => { :name => :label_duplicates, :sym_name => :label_duplicates, :order => 2 }, + TYPE_DUPLICATES => { :name => :label_duplicates, :sym_name => :label_duplicated_by, :order => 2 }, TYPE_BLOCKS => { :name => :label_blocks, :sym_name => :label_blocked_by, :order => 3 }, TYPE_PRECEDES => { :name => :label_precedes, :sym_name => :label_follows, :order => 4 }, }.freeze |