0
0
Fork 0

Fetch remote image using http.rb (#3114)

This commit is contained in:
Yamagishi Kazutoshi 2017-05-18 22:43:10 +09:00 committed by Eugen Rochko
parent b11c4326d2
commit 79ef8b3653
8 changed files with 46 additions and 32 deletions

View file

@ -36,6 +36,7 @@ class PreviewCard < ApplicationRecord
has_attached_file :image, styles: { original: '120x120#' }, convert_options: { all: '-quality 80 -strip' }
include Attachmentable
include Remotable
validates :url, presence: true
validates_attachment_content_type :image, content_type: IMAGE_MIME_TYPES