fix: Correctly handle wp_sequence_counter on project copy

This commit is contained in:
Tomas Hykel
2026-05-07 22:12:27 +02:00
parent bd7a0cfde1
commit 8e70767c5f
2 changed files with 13 additions and 1 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ module Projects
end
def skipped_attributes
%w[id created_at updated_at name identifier active templated lft rgt]
%w[id created_at updated_at name identifier active templated lft rgt wp_sequence_counter]
end
def source_attributes
@@ -381,6 +381,18 @@ RSpec.describe(
end
end
context "when source project has a non-zero wp_sequence_counter",
with_settings: { work_packages_identifier: "semantic" } do
before do
source.update_column(:wp_sequence_counter, 5)
end
it "succeeds and resets wp_sequence_counter to 0 on the copy" do
expect(subject).to be_success
expect(project_copy.wp_sequence_counter).to eq(0)
end
end
context "with all modules selected" do
let(:only_args) { all_modules }
let(:storage1) { source_automatic_project_storage.storage }