diff --git a/app/models/attachment.rb b/app/models/attachment.rb index e862ede7..9c65cec1 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -17,19 +17,19 @@ class Attachment < ApplicationRecord validates_attachment_content_type :file, content_type: Attachable.allowed_types def image? - Attachable.image_types.include(file.instance.file_content_type) + Attachable.image_types.include?(file.instance.file_content_type) end def audio? - Attachable.audio_types.include(file.instance.file_content_type) + Attachable.audio_types.include?(file.instance.file_content_type) end def text? - Attachable.text_types.include(file.instance.file_content_type) + Attachable.text_types.include?(file.instance.file_content_type) end def pdf? - Attachable.pdf_types.include(file.instance.file_content_type) + Attachable.pdf_types.include?(file.instance.file_content_type) end def document? diff --git a/app/models/concerns/attachable.rb b/app/models/concerns/attachable.rb index dbcc2a2a..87250a09 100644 --- a/app/models/concerns/attachable.rb +++ b/app/models/concerns/attachable.rb @@ -36,7 +36,7 @@ module Attachable end def text_types - ['text/plain', 'text/markdown'] + ['text/plain'] end def pdf_types