From c7b68b6e66a487b8b12556fe10dd1dde78581eca Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 5 Jul 2016 10:51:11 -0400 Subject: Dumb-down avatar presence check in `avatar_url` methods `avatar.present?` goes through CarrierWave, and checks that the file exists on disk and checks its filesize. Because we're hitting the disk, this adds extra overhead to something where the worst-case scenario is rendering a broken image. Instead, we now just check that the _database attribute_ is present, which is good enough for our purposes. See https://gitlab.com/gitlab-org/gitlab-ce/issues/19273 --- app/models/group.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/group.rb') diff --git a/app/models/group.rb b/app/models/group.rb index a8be7004ee8..37631b99701 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -90,7 +90,7 @@ class Group < Namespace end def avatar_url(size = nil) - if avatar.present? + if self[:avatar].present? [gitlab_config.url, avatar.url].join end end -- cgit v1.2.1