markdown is also plaintext
This commit is contained in:
parent
0b110cf469
commit
3007cb78c1
2 changed files with 5 additions and 5 deletions
|
@ -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?
|
||||
|
|
|
@ -36,7 +36,7 @@ module Attachable
|
|||
end
|
||||
|
||||
def text_types
|
||||
['text/plain', 'text/markdown']
|
||||
['text/plain']
|
||||
end
|
||||
|
||||
def pdf_types
|
||||
|
|
Loading…
Add table
Reference in a new issue