diff --git a/app/models/issue_relation.rb b/app/models/issue_relation.rb index c66103c..5b050c9 100644 --- a/app/models/issue_relation.rb +++ b/app/models/issue_relation.rb @@ -115,6 +115,8 @@ class IssueRelation < ActiveRecord::Base private # 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 def reverse_if_needed if TYPES.has_key?(relation_type) && TYPES[relation_type][:reverse] issue_tmp = issue_to diff --git a/test/unit/issue_relation_test.rb b/test/unit/issue_relation_test.rb index 3c8347b..fa05944 100644 --- a/test/unit/issue_relation_test.rb +++ b/test/unit/issue_relation_test.rb @@ -50,9 +50,6 @@ class IssueRelationTest < ActiveSupport::TestCase assert_equal from, relation.issue_to end - # TODO : document why it shouldn't be reversed if validation fails : having - # relations reversed before the validation would allow simpler code for the - # validation def test_follows_relation_should_not_be_reversed_if_validation_fails from = Issue.find(1) to = Issue.find(2)