Skip to content

Commit

Permalink
Fixes #5591: Setting deleted_in_original_table flag to false when cre…
Browse files Browse the repository at this point in the history
…ating new version records.
  • Loading branch information
tiss committed Sep 25, 2012
1 parent 6b916da commit 4162afd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion test/fixtures/pages_h.yml
Expand Up @@ -6,7 +6,7 @@ welcome_2:
version: 24
author_id: 1
revisor_id: 1
deleted_in_original_table: false
deleted_in_original_table: 0
welcome_1:
id: 2
page_id: 1
Expand All @@ -15,3 +15,4 @@ welcome_1:
version: 23
author_id: 2
revisor_id: 2
deleted_in_original_table: 0
12 changes: 9 additions & 3 deletions test/versioned_test.rb
Expand Up @@ -370,9 +370,15 @@ def test_without_locking_reverts_optimistic_locking_settings_if_block_raises_exc

def test_deleted_in_original_table
record = Page::Version.find 2
assert !record.deleted_in_original_table
record.page.destroy
assert_equal false, record.deleted_in_original_table
record.page.title = "Title changed"
assert record.page.save

record = Page::Version.find 3
assert record.deleted_in_original_table
assert_equal false, record.deleted_in_original_table

record.page.destroy
record = Page::Version.find 4
assert_equal true, record.deleted_in_original_table
end
end

0 comments on commit 4162afd

Please sign in to comment.