increase tsv extracted check resilience

The data in the attachments table might be corrupted e.g. when:
* A plugin was installed which had attachments defined
* Some container type was defined that never was attachable

In that case, the check now disregards those attachments on the check for whether they are tsv extracted
pull/8084/head
ulferts 5 years ago
parent a5e60c5d82
commit f844023b19
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 6
      app/models/attachment.rb

@ -236,7 +236,11 @@ class Attachment < ActiveRecord::Base
.pluck(:container_type)
.compact
.select do |container_class|
container_class.constantize.attachment_tsv_extracted?
klass = container_class.constantize
klass.respond_to?(:attachment_tsv_extracted?) && klass.attachment_tsv_extracted?
rescue NameError
false
end
end

Loading…
Cancel
Save