Set default profile pic

This commit is contained in:
Eric 2020-06-02 15:50:18 -05:00
parent 1c49a696e9
commit 28e0e373df

View file

@ -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