handle ifc_attachment already being loaded

pull/7876/head
ulferts 5 years ago
parent 764a2a8f62
commit 6836febb92
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 6
      modules/ifc_models/app/models/ifc_models/ifc_model.rb

@ -36,7 +36,11 @@ module IFCModels
##
# Delete the given named description
def get_attached_type(key)
attachments.find_by_description(key.to_s)
if attachments.loaded?
attachments.detect { |a| a.description == key.to_s && !a.marked_for_destruction? }
else
attachments.find_by_description(key.to_s)
end
end
##

Loading…
Cancel
Save