Sha256: 00768e80c73256fbf8f9a0117bcada7c9889a805173f6f5f2d7958e0bee2db08
Contents?: true
Size: 468 Bytes
Versions: 36
Compression:
Stored size: 468 Bytes
Contents
module Dorsale::Users::Avatar def self.included(user_model) user_model.class_eval do mount_uploader :avatar, ::Dorsale::AvatarUploader def avatar_url local_avatar_url || gravatar_url end def local_avatar_url avatar.try(:url) end def gravatar_url gravatar_id = Digest::MD5.hexdigest(email.to_s) "https://www.gravatar.com/avatar/#{gravatar_id}?default=mm&size=200" end end end end
Version data entries
36 entries across 36 versions & 1 rubygems