From d3a19b378520f0c3f5954f7699801dc28408bf53 Mon Sep 17 00:00:00 2001 From: Jeffrey Warren Date: Mon, 23 Aug 2021 14:10:38 -0400 Subject: [PATCH] Fixes to profile images for fog/Google Cloud Storage (#9958) * Update user.rb * adjusted url param for profile images * adjusted custom route for profile images --- app/models/user.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 9ed9f3aeed..c7a8c290f7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -38,9 +38,10 @@ module Frequency c.validates_format_of_login_field_options = { with: Authlogic::Regex::LOGIN, message: I18n.t('error_messages.login_invalid', default: "can only consist of alphabets, numbers, underscore '_', and hyphen '-'.") } end - has_attached_file :photo, styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' }, - url: '/system/profile/photos/:id/:style/:basename.:extension' - #:path => ":rails_root/public/system/images/photos/:id/:style/:basename.:extension" + has_attached_file :photo, + styles: { thumb: '200x200#', medium: '500x500#', large: '800x800#' }, + url: '/public/system/profile/photos/:id/:style/:basename.:extension', + path: ':rails_root/public/system/public/system/profile/photos/:id/:style/:filename' do_not_validate_attachment_file_type :photo_file_name # validates_attachment_content_type :photo_file_name, :content_type => %w(image/jpeg image/jpg image/png)