]> source.dussan.org Git - redmine.git/commitdiff
Document why relation is reversed after validation.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 4 Jul 2011 17:31:06 +0000 (17:31 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 4 Jul 2011 17:31:06 +0000 (17:31 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6178 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue_relation.rb
test/unit/issue_relation_test.rb

index c66103c51986eaaf953f4ac5336ab1d71717c7c9..5b050c9a3e01458eee6fbdc12f1e286128eb7796 100644 (file)
@@ -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
index 3c8347b45de874d83b5d0f5395bca7e95f2437c8..fa05944969148d4a5538c8ee8e10b90baa64b490 100644 (file)
@@ -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)