Changes update_column to update_attributes in ProjectTreeRestorer#restore_project by using timeless to maintain the current timestamps
This commit is contained in:
parent
a0f2345819
commit
6dfab42236
3 changed files with 20 additions and 1 deletions
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
title: Importing a project no longer fails when visibility level holds a string value
|
||||||
|
type
|
||||||
|
merge_request: 21242
|
||||||
|
author:
|
||||||
|
type: fixed
|
|
@ -94,7 +94,10 @@ module Gitlab
|
||||||
end
|
end
|
||||||
|
|
||||||
def restore_project
|
def restore_project
|
||||||
@project.update_columns(project_params)
|
Gitlab::Timeless.timeless(@project) do
|
||||||
|
@project.update(project_params)
|
||||||
|
end
|
||||||
|
|
||||||
@project
|
@project
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,16 @@ describe Gitlab::ImportExport::Importer do
|
||||||
|
|
||||||
importer.execute
|
importer.execute
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'sets the correct visibility_level when visibility level is a string' do
|
||||||
|
project.create_or_update_import_data(
|
||||||
|
data: { override_params: { visibility_level: Gitlab::VisibilityLevel::PRIVATE.to_s } }
|
||||||
|
)
|
||||||
|
|
||||||
|
importer.execute
|
||||||
|
|
||||||
|
expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when project successfully restored' do
|
context 'when project successfully restored' do
|
||||||
|
|
Loading…
Reference in a new issue