From 28e0e373dfd10d5c3ea2d4117e960fa423757235 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 2 Jun 2020 15:50:18 -0500 Subject: [PATCH] Set default profile pic --- app/models/profile.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/profile.rb b/app/models/profile.rb index a8ab05b8..538205c8 100755 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -54,6 +54,8 @@ class Profile < ApplicationRecord self.name ||= user.name if user self.email ||= user.email if user self.picture ||= user.picture if user + 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? self.name ||= first_name + ' ' + last_name end