@@ -115,6 +115,8 class IssueRelation < ActiveRecord::Base | |||
|
115 | 115 | private |
|
116 | 116 | |
|
117 | 117 | # Reverses the relation if needed so that it gets stored in the proper way |
|
118 | # Should not be reversed before validation so that it can be displayed back | |
|
119 | # as entered on new relation form | |
|
118 | 120 | def reverse_if_needed |
|
119 | 121 | if TYPES.has_key?(relation_type) && TYPES[relation_type][:reverse] |
|
120 | 122 | issue_tmp = issue_to |
@@ -50,9 +50,6 class IssueRelationTest < ActiveSupport::TestCase | |||
|
50 | 50 | assert_equal from, relation.issue_to |
|
51 | 51 | end |
|
52 | 52 | |
|
53 | # TODO : document why it shouldn't be reversed if validation fails : having | |
|
54 | # relations reversed before the validation would allow simpler code for the | |
|
55 | # validation | |
|
56 | 53 | def test_follows_relation_should_not_be_reversed_if_validation_fails |
|
57 | 54 | from = Issue.find(1) |
|
58 | 55 | to = Issue.find(2) |
General Comments 0
You need to be logged in to leave comments.
Login now