summaryrefslogtreecommitdiffstats
path: root/app/models/issue_relation.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2017-11-30 00:02:02 +0000
committerGo MAEDA <maeda@farend.jp>2017-11-30 00:02:02 +0000
commit0ed07156ad3b106cc73130549a487d54bf5ca64f (patch)
tree52ad8ac32a8d86c1b6928cb11cf550d50f1c6589 /app/models/issue_relation.rb
parent3a310ccc2e1b8d7ce6883d73059ba2722bfbe99f (diff)
downloadredmine-0ed07156ad3b106cc73130549a487d54bf5ca64f.tar.gz
redmine-0ed07156ad3b106cc73130549a487d54bf5ca64f.zip
Reverted r17054 (#27663).
The change breaks test/functional/issue_relations_controller_test.rb. git-svn-id: http://svn.redmine.org/redmine/trunk@17055 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/issue_relation.rb')
-rw-r--r--app/models/issue_relation.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/app/models/issue_relation.rb b/app/models/issue_relation.rb
index 0a47b1341..44c7c8dba 100644
--- a/app/models/issue_relation.rb
+++ b/app/models/issue_relation.rb
@@ -207,19 +207,13 @@ class IssueRelation < ActiveRecord::Base
# Reverses the relation if needed so that it gets stored in the proper way
# Should not be reversed before validation so that it can be displayed back
- # as entered on new relation form.
- #
- # Orders relates relations by ID, so that uniqueness index in DB is triggered
- # on concurrent access.
+ # as entered on new relation form
def reverse_if_needed
if TYPES.has_key?(relation_type) && TYPES[relation_type][:reverse]
issue_tmp = issue_to
self.issue_to = issue_from
self.issue_from = issue_tmp
self.relation_type = TYPES[relation_type][:reverse]
-
- elsif relation_type == TYPE_RELATES && issue_from_id > issue_to_id
- self.issue_to, self.issue_from = issue_from, issue_to
end
end
@@ -234,8 +228,6 @@ class IssueRelation < ActiveRecord::Base
issue_from.blocks? issue_to
when 'blocks'
issue_to.blocks? issue_from
- when 'relates'
- self.class.where(issue_from_id: issue_to, issue_to_id: issue_from).present?
else
false
end