markdown is also plaintext

This commit is contained in:
Devin Howard 2017-01-23 13:42:13 -05:00
parent 0b110cf469
commit 3007cb78c1
2 changed files with 5 additions and 5 deletions

View file

@ -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?

View file

@ -36,7 +36,7 @@ module Attachable
end
def text_types
['text/plain', 'text/markdown']
['text/plain']
end
def pdf_types