Document why relation is reversed after validation.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6178 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
ea06b3cca5
commit
79f25c08f8
|
@ -115,6 +115,8 @@ class IssueRelation < ActiveRecord::Base
|
||||||
private
|
private
|
||||||
|
|
||||||
# Reverses the relation if needed so that it gets stored in the proper way
|
# 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
|
def reverse_if_needed
|
||||||
if TYPES.has_key?(relation_type) && TYPES[relation_type][:reverse]
|
if TYPES.has_key?(relation_type) && TYPES[relation_type][:reverse]
|
||||||
issue_tmp = issue_to
|
issue_tmp = issue_to
|
||||||
|
|
|
@ -50,9 +50,6 @@ class IssueRelationTest < ActiveSupport::TestCase
|
||||||
assert_equal from, relation.issue_to
|
assert_equal from, relation.issue_to
|
||||||
end
|
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
|
def test_follows_relation_should_not_be_reversed_if_validation_fails
|
||||||
from = Issue.find(1)
|
from = Issue.find(1)
|
||||||
to = Issue.find(2)
|
to = Issue.find(2)
|
||||||
|
|
Loading…
Reference in New Issue