Skip to content

Commit 30cb11c

Browse files
committed
add check to avoid reimporting the same asset
1 parent 7009ce2 commit 30cb11c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/project_importer.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def create_scratch_component
8080
def create_scratch_asset(asset)
8181
filename = asset[:filename]
8282
io = asset[:io]
83+
return if ScratchAsset.global_assets.exists?(filename:)
8384

8485
asset = ScratchAsset.new(filename:, uploaded_user_id: nil, project_id: nil)
8586
asset.file.attach(io:, filename:)

0 commit comments

Comments
 (0)