Sha256: fb741f8f0ba133603c43da556d43fd9f94773c9f20c6eae9ef6f061b43728074
Contents?: true
Size: 439 Bytes
Versions: 20
Compression:
Stored size: 439 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 "https://www.gravatar.com/avatar/" + Digest::MD5.hexdigest(email.to_s) + "?default=mm&size=200" end end end end
Version data entries
20 entries across 20 versions & 1 rubygems