From c31cce68bb7c587ac85e818968ed1864da2e556c Mon Sep 17 00:00:00 2001 From: Mateus Rambo Strey <mars11@inf.ufpr.br> Date: Tue, 6 Dec 2016 14:03:45 -0200 Subject: [PATCH] change allowed content_type in user avatar --- app/models/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 03aa1154..dc186028 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -74,7 +74,7 @@ class User < ApplicationRecord after_create :default_role has_attached_file :avatar, styles: { medium: '300x300>', thumb: '60x60>' }, default_url: '' - validates_attachment_content_type :avatar, content_type: %r{ \Aimage\/.*\Z } + validates_attachment_content_type :avatar, content_type: ['image/jpg', 'image/jpeg', 'image/png', 'image/gif'] validates :terms_of_service, acceptance: true searchkick language: 'brazilian', match: :word_start, searchable: [:name], callbacks: :async -- GitLab