0
0
Fork 0

Upgrade Paperclip to 5, AWS-SDK to 2, do not generate medium/small versions of avatars

This commit is contained in:
Eugen Rochko 2016-11-29 14:20:15 +01:00
parent cc70f28f19
commit 5973ca3d11
6 changed files with 33 additions and 20 deletions

View file

@ -13,12 +13,12 @@ class Account < ApplicationRecord
validates :username, presence: true, uniqueness: { scope: :domain, case_sensitive: true }, unless: 'local?'
# Avatar upload
has_attached_file :avatar, styles: { large: '300x300#', medium: '96x96#', small: '48x48#' }
has_attached_file :avatar, styles: { large: '300x300#' }, convert_options: { all: '-strip' }
validates_attachment_content_type :avatar, content_type: IMAGE_MIME_TYPES
validates_attachment_size :avatar, less_than: 2.megabytes
# Header upload
has_attached_file :header, styles: { medium: '700x335#' }
has_attached_file :header, styles: { medium: '700x335#' }, convert_options: { all: '-strip' }
validates_attachment_content_type :header, content_type: IMAGE_MIME_TYPES
validates_attachment_size :header, less_than: 2.megabytes