Add scale argument in user class

This commit is contained in:
Jan-Gerd Tenberge 2015-09-26 21:51:02 +02:00
parent f93177c6a3
commit 8d620e39c9
2 changed files with 4 additions and 4 deletions

View file

@ -68,13 +68,13 @@ module ApplicationHelper
end
end
def avatar_icon(user_email = '', size = nil)
def avatar_icon(user_email = '', size = nil, scale = 2)
user = User.find_by(email: user_email)
if user
user.avatar_url(size) || default_avatar
else
gravatar_icon(user_email, size)
gravatar_icon(user_email, size, scale)
end
end

View file

@ -633,11 +633,11 @@ class User < ActiveRecord::Base
email.start_with?('temp-email-for-oauth')
end
def avatar_url(size = nil)
def avatar_url(size = nil, scale = 2)
if avatar.present?
[gitlab_config.url, avatar.url].join
else
GravatarService.new.execute(email, size)
GravatarService.new.execute(email, size, scale)
end
end