about summary refs log tree commit diff
path: root/app/models/preview_card.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-09-30 00:29:38 +0200
committerGitHub <noreply@github.com>2021-09-30 00:29:38 +0200
commit5e36c3b44c052afb1aa61e2405c595c726bc9503 (patch)
tree899cb5f54098d08f28dad2c8ee555b3557dead16 /app/models/preview_card.rb
parent00889b313176308018d66e54b5cb7dcc92da1587 (diff)
parent29b5c5f4830f9bda0af352b1d6ac73830a6cfd4e (diff)
Merge pull request #1612 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/models/preview_card.rb')
-rw-r--r--app/models/preview_card.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/preview_card.rb b/app/models/preview_card.rb
index a6ec839f8..bca3a3ce8 100644
--- a/app/models/preview_card.rb
+++ b/app/models/preview_card.rb
@@ -27,6 +27,8 @@
 #
 
 class PreviewCard < ApplicationRecord
+  include Attachmentable
+
   IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif'].freeze
   LIMIT = 1.megabytes
 
@@ -41,9 +43,7 @@ class PreviewCard < ApplicationRecord
 
   has_and_belongs_to_many :statuses
 
-  has_attached_file :image, processors: [:thumbnail, :blurhash_transcoder], styles: ->(f) { image_styles(f) }, convert_options: { all: '-quality 80 -strip' }
-
-  include Attachmentable
+  has_attached_file :image, processors: [:thumbnail, :blurhash_transcoder], styles: ->(f) { image_styles(f) }, convert_options: { all: '-quality 80 -strip' }, validate_media_type: false
 
   validates :url, presence: true, uniqueness: true
   validates_attachment_content_type :image, content_type: IMAGE_MIME_TYPES