summaryrefslogtreecommitdiff
path: root/app/models/group.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-07-05 10:51:11 -0400
committerRobert Speicher <rspeicher@gmail.com>2016-07-05 10:51:11 -0400
commitc7b68b6e66a487b8b12556fe10dd1dde78581eca (patch)
tree78cf2dde88e29674d8fa2f78293fb1b20ea887c8 /app/models/group.rb
parent38533a2f4252921bbfde126c887510481aeaa01e (diff)
downloadgitlab-ce-c7b68b6e66a487b8b12556fe10dd1dde78581eca.tar.gz
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
Diffstat (limited to 'app/models/group.rb')
-rw-r--r--app/models/group.rb2
1 files changed, 1 insertions, 1 deletions
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