Set default profile pic
This commit is contained in:
parent
1c49a696e9
commit
28e0e373df
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue