From 354b93bbf9b7cf266e4ce83dab576d48c74f6598 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 2 Jun 2020 16:35:43 -0500 Subject: [PATCH] Fix setting the profile pic from user pic on creation --- app/models/profile.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/profile.rb b/app/models/profile.rb index 538205c8..afe1d5fd 100755 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -53,7 +53,7 @@ class Profile < ApplicationRecord def set_defaults self.name ||= user.name if user self.email ||= user.email if user - self.picture ||= user.picture if user + self.picture.attach(user.picture) if user && user.picture.attached? picture.attach(io: File.open(Settings.default.image.profile), filename: "profile-image.png") unless self.picture.attached? if self.name.blank? && first_name.present? && last_name.present?