mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-16 10:06:57 +08:00
Improve code readability [SCI-3959]
This commit is contained in:
parent
3d9c2282f3
commit
2608f3f1cf
1 changed files with 3 additions and 1 deletions
|
@ -2,8 +2,10 @@
|
|||
|
||||
module ActiveStorage
|
||||
class Analyzer::CustomImageAnalyzer < Analyzer::ImageAnalyzer
|
||||
JPEG_MIME_TYPES = ['image/jpeg', 'image/pjpeg'].freeze
|
||||
|
||||
def self.accept?(blob)
|
||||
['image/jpeg', 'image/pjpeg'].include?(blob.content_type) && blob.attachments.take.record_type == 'Asset'
|
||||
blob.content_type.in?(JPEG_MIME_TYPES) && blob.attachments.take.record_type == 'Asset'
|
||||
end
|
||||
|
||||
def metadata
|
||||
|
|
Loading…
Add table
Reference in a new issue