Detect extension for preview card (#2679)
* Detect extension for preview card * next
This commit is contained in:
parent
5259319cf5
commit
1899cf5f04
3 changed files with 24 additions and 15 deletions
|
@ -11,6 +11,8 @@ class PreviewCard < ApplicationRecord
|
|||
|
||||
has_attached_file :image, styles: { original: '120x120#' }, convert_options: { all: '-quality 80 -strip' }
|
||||
|
||||
include Attachmentable
|
||||
|
||||
validates :url, presence: true
|
||||
validates_attachment_content_type :image, content_type: IMAGE_MIME_TYPES
|
||||
validates_attachment_size :image, less_than: 1.megabytes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue