From 3007cb78c14a711d316d4b61c15a6d4fb4fea539 Mon Sep 17 00:00:00 2001 From: Devin Howard Date: Mon, 23 Jan 2017 13:42:13 -0500 Subject: [PATCH] markdown is also plaintext --- app/models/attachment.rb | 8 ++++---- app/models/concerns/attachable.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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