Don't reload the issue in after_save callback.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11495 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
953b3619d4
commit
5bf647f290
@ -1174,7 +1174,6 @@ class Issue < ActiveRecord::Base
|
|||||||
if @parent_issue
|
if @parent_issue
|
||||||
move_to_child_of(@parent_issue)
|
move_to_child_of(@parent_issue)
|
||||||
end
|
end
|
||||||
reload
|
|
||||||
elsif parent_issue_id != parent_id
|
elsif parent_issue_id != parent_id
|
||||||
former_parent_id = parent_id
|
former_parent_id = parent_id
|
||||||
# moving an existing issue
|
# moving an existing issue
|
||||||
@ -1185,7 +1184,6 @@ class Issue < ActiveRecord::Base
|
|||||||
# to another tree
|
# to another tree
|
||||||
unless root?
|
unless root?
|
||||||
move_to_right_of(root)
|
move_to_right_of(root)
|
||||||
reload
|
|
||||||
end
|
end
|
||||||
old_root_id = root_id
|
old_root_id = root_id
|
||||||
self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id )
|
self.root_id = (@parent_issue.nil? ? id : @parent_issue.root_id )
|
||||||
@ -1199,7 +1197,6 @@ class Issue < ActiveRecord::Base
|
|||||||
move_to_child_of(@parent_issue)
|
move_to_child_of(@parent_issue)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
reload
|
|
||||||
# delete invalid relations of all descendants
|
# delete invalid relations of all descendants
|
||||||
self_and_descendants.each do |issue|
|
self_and_descendants.each do |issue|
|
||||||
issue.relations.each do |relation|
|
issue.relations.each do |relation|
|
||||||
|
@ -82,8 +82,8 @@ class GanttsControllerTest < ActionController::TestCase
|
|||||||
|
|
||||||
def test_gantt_should_display_relations
|
def test_gantt_should_display_relations
|
||||||
IssueRelation.delete_all
|
IssueRelation.delete_all
|
||||||
issue1 = Issue.generate!(:start_date => 1.day.from_now, :due_date => 3.day.from_now)
|
issue1 = Issue.generate!(:start_date => 1.day.from_now.to_date, :due_date => 3.day.from_now.to_date)
|
||||||
issue2 = Issue.generate!(:start_date => 1.day.from_now, :due_date => 3.day.from_now)
|
issue2 = Issue.generate!(:start_date => 1.day.from_now.to_date, :due_date => 3.day.from_now.to_date)
|
||||||
IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => 'precedes')
|
IssueRelation.create!(:issue_from => issue1, :issue_to => issue2, :relation_type => 'precedes')
|
||||||
|
|
||||||
get :show
|
get :show
|
||||||
|
@ -1411,6 +1411,7 @@ class IssueTest < ActiveSupport::TestCase
|
|||||||
:relation_type => IssueRelation::TYPE_PRECEDES)
|
:relation_type => IssueRelation::TYPE_PRECEDES)
|
||||||
assert_equal Date.parse('2012-10-18'), issue2.reload.start_date
|
assert_equal Date.parse('2012-10-18'), issue2.reload.start_date
|
||||||
|
|
||||||
|
issue1.reload
|
||||||
issue1.due_date = '2012-10-23'
|
issue1.due_date = '2012-10-23'
|
||||||
issue1.save!
|
issue1.save!
|
||||||
issue2.reload
|
issue2.reload
|
||||||
@ -1425,6 +1426,7 @@ class IssueTest < ActiveSupport::TestCase
|
|||||||
:relation_type => IssueRelation::TYPE_PRECEDES)
|
:relation_type => IssueRelation::TYPE_PRECEDES)
|
||||||
assert_equal Date.parse('2012-10-18'), issue2.reload.start_date
|
assert_equal Date.parse('2012-10-18'), issue2.reload.start_date
|
||||||
|
|
||||||
|
issue1.reload
|
||||||
issue1.start_date = '2012-09-17'
|
issue1.start_date = '2012-09-17'
|
||||||
issue1.due_date = '2012-09-18'
|
issue1.due_date = '2012-09-18'
|
||||||
issue1.save!
|
issue1.save!
|
||||||
@ -1443,6 +1445,7 @@ class IssueTest < ActiveSupport::TestCase
|
|||||||
:relation_type => IssueRelation::TYPE_PRECEDES)
|
:relation_type => IssueRelation::TYPE_PRECEDES)
|
||||||
assert_equal Date.parse('2012-10-18'), issue2.reload.start_date
|
assert_equal Date.parse('2012-10-18'), issue2.reload.start_date
|
||||||
|
|
||||||
|
issue1.reload
|
||||||
issue1.start_date = '2012-09-17'
|
issue1.start_date = '2012-09-17'
|
||||||
issue1.due_date = '2012-09-18'
|
issue1.due_date = '2012-09-18'
|
||||||
issue1.save!
|
issue1.save!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user