diff options
Diffstat (limited to 'app/models/preview_card.rb')
-rw-r--r-- | app/models/preview_card.rb | 6 |
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 |