Skip to content

Commit 6132050

Browse files
authored
Merge pull request #3448 from manyfold3d/fix-model-merge
Fix errors when merging models
2 parents 09aaff6 + 6d1e049 commit 6132050

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/models/model_file.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,10 @@ def mesh
178178
memoize :mesh
179179

180180
def reattach!
181-
attachment_attacher.attach attachment, storage: model.library.storage_key
182-
save!
181+
if attachment.id != path_within_library || attachment.storage_key != model.library.storage_key
182+
attachment_attacher.attach attachment, storage: model.library.storage_key
183+
save!
184+
end
183185
end
184186

185187
def convert_to!(format)

0 commit comments

Comments
 (0)