parent
807f79ef5d
commit
3d379b071d
1 changed files with 9 additions and 0 deletions
|
@ -110,6 +110,15 @@ class User < ApplicationRecord
|
|||
inboxes.where(account_id: Current.account.id)
|
||||
end
|
||||
|
||||
alias avatar_img_url avatar_url
|
||||
def avatar_url
|
||||
if avatar_img_url == ''
|
||||
hash = Digest::MD5.hexdigest(email)
|
||||
return "https://www.gravatar.com/avatar/#{hash}"
|
||||
end
|
||||
avatar_img_url
|
||||
end
|
||||
|
||||
def administrator?
|
||||
current_account_user&.administrator?
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue