fix deletes again (reloading issues this time)

This commit is contained in:
Torsten 2023-01-05 21:50:56 +02:00
parent db82bc5655
commit 178c0ba9d2
3 changed files with 5 additions and 5 deletions

View File

@ -41,7 +41,8 @@ module Merged
def delete_and_reset_index def delete_and_reset_index
delete_save! delete_save!
section.reset_index section.reset_index
save Section.find(section_id).reset_index
Card.save_all
end end
def self.new_card(card_template , section_id , index) def self.new_card(card_template , section_id , index)

View File

@ -78,8 +78,8 @@ module Merged
def delete_and_reset_index def delete_and_reset_index
delete delete
page.reset_index Page.find(page_id).reset_index
save Section.save_all
end end
def self.new_section(template , page_id , index) def self.new_section(template , page_id , index)

View File

@ -16,7 +16,7 @@ module Merged
section = first.section section = first.section
index = first.index index = first.index
first.delete_and_reset_index first.delete_and_reset_index
assert_equal index , section.cards.second.index assert_equal index , section.cards.first.index
end end
def test_adds def test_adds
@ -25,6 +25,5 @@ module Merged
assert_equal "NEW" , card.header assert_equal "NEW" , card.header
end end
end end
end end