feat: Unify user and super admin credentials (#3830)

Fixes: #3061, #3489
This commit is contained in:
Sojan Jose
2022-01-25 16:58:49 -08:00
committed by GitHub
parent 23965fbaa3
commit 34e8ad9dc5
34 changed files with 303 additions and 233 deletions

View File

@@ -12,7 +12,7 @@ module Avatarable
def avatar_url
return url_for(avatar.representation(resize: '250x250')) if avatar.attached? && avatar.representable?
if [User, Contact].include?(self.class) && email.present?
if [SuperAdmin, User, Contact].include?(self.class) && email.present?
hash = Digest::MD5.hexdigest(email)
return "https://www.gravatar.com/avatar/#{hash}?d=404"
end