Sha256: cd0a56b587b7c9f50fe619d6297b0d9d543b46e3204763cc67b23d2717821c9c
Contents?: true
Size: 757 Bytes
Versions: 62
Compression:
Stored size: 757 Bytes
Contents
module Workarea class User module Avatar extend ActiveSupport::Concern included do extend Dragonfly::Model field :avatar_name, type: String field :avatar_uid, type: String dragonfly_accessor :avatar, app: :workarea end def avatar_image_url if avatar.present? avatar.process(:avatar).url elsif !Rails.env.test? gravatar_url else 'workarea/core/placeholder.png' end end def gravatar_url(options = {}) options = Workarea.config.gravatar_options.merge(options) hash = Digest::MD5.hexdigest(email.downcase) "https://www.gravatar.com/avatar/#{hash}?#{options.to_query}" end end end end
Version data entries
62 entries across 62 versions & 1 rubygems