fix deletes again (reloading issues this time)
This commit is contained in:
parent
db82bc5655
commit
178c0ba9d2
@ -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)
|
||||||
|
@ -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)
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user