mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-25 09:13:05 +08:00
Fix cloning for LinkedRepository coused by external_id uniqueness constraint [SCI-9879] (#7063)
This commit is contained in:
parent
d5df5205ad
commit
8abc39d4f6
2 changed files with 3 additions and 7 deletions
|
@ -9,7 +9,7 @@ AllCops:
|
|||
- "spec/**/*"
|
||||
NewCops: enable
|
||||
UseCache: false
|
||||
TargetRubyVersion: 3.0
|
||||
TargetRubyVersion: 3.1
|
||||
|
||||
##################### Style ####################################
|
||||
|
||||
|
|
|
@ -200,17 +200,13 @@ class Repository < RepositoryBase
|
|||
fields
|
||||
end
|
||||
|
||||
def copy(created_by, name)
|
||||
def copy(created_by, new_name)
|
||||
new_repo = nil
|
||||
|
||||
begin
|
||||
Repository.transaction do
|
||||
# Clone the repository object
|
||||
new_repo = dup
|
||||
new_repo.created_by = created_by
|
||||
new_repo.name = name
|
||||
new_repo.permission_level = Extends::SHARED_OBJECTS_PERMISSION_LEVELS[:not_shared]
|
||||
new_repo.save!
|
||||
new_repo = Repository.create!(name: new_name, team:, created_by:)
|
||||
|
||||
# Clone columns (only if new_repo was saved)
|
||||
repository_columns.find_each do |col|
|
||||
|
|
Loading…
Reference in a new issue