Commit e6242106 authored by Gabriel Mazetto's avatar Gabriel Mazetto

GeoAwareAvatar will pass all method attributes to `super`

parent 259c23dd
...@@ -4,11 +4,11 @@ module EE ...@@ -4,11 +4,11 @@ module EE
# This module is intended to encapsulate Geo-specific logic # This module is intended to encapsulate Geo-specific logic
# and be **prepended** in the `Group`, `User`, `Project` models # and be **prepended** in the `Group`, `User`, `Project` models
module GeoAwareAvatar module GeoAwareAvatar
def avatar_url(size = nil) def avatar_url(size = nil, scale = 2)
if self[:avatar].present? && ::Gitlab::Geo.secondary? if self[:avatar].present? && ::Gitlab::Geo.secondary?
File.join(::Gitlab::Geo.primary_node.url, avatar.url) File.join(::Gitlab::Geo.primary_node.url, avatar.url)
else else
super() super
end end
end end
end end
......
...@@ -115,7 +115,7 @@ class Group < Namespace ...@@ -115,7 +115,7 @@ class Group < Namespace
allowed_by_projects allowed_by_projects
end end
def avatar_url(size = nil) def avatar_url(size = nil, scale = nil)
if self[:avatar].present? if self[:avatar].present?
[gitlab_config.url, avatar.url].join [gitlab_config.url, avatar.url].join
end end
......
...@@ -912,7 +912,7 @@ class Project < ActiveRecord::Base ...@@ -912,7 +912,7 @@ class Project < ActiveRecord::Base
repository.avatar repository.avatar
end end
def avatar_url def avatar_url(size = nil, scale = nil)
if self[:avatar].present? if self[:avatar].present?
[gitlab_config.url, avatar.url].join [gitlab_config.url, avatar.url].join
elsif avatar_in_git elsif avatar_in_git
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment