diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2018-03-27 20:59:14 +0300 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2018-03-27 21:13:48 +0300 |
commit | fca02e24768ea11d2f04a58437cb5557fd3c93fa (patch) | |
tree | ff4ec31775938eccad3ab642388f10165adeb702 /app/serializers | |
parent | de0c4730bb83b94195678e5ad4865ea648e6585f (diff) |
Update styling and use Gitlab::Utils.to_boolean
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/status_entity.rb | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/app/serializers/status_entity.rb b/app/serializers/status_entity.rb index 1338068068a..a7c2e21e92b 100644 --- a/app/serializers/status_entity.rb +++ b/app/serializers/status_entity.rb @@ -7,13 +7,14 @@ class StatusEntity < Grape::Entity expose :details_path expose :favicon do |status| - dir = 'ci_favicons' - - if ENV['CANARY'] - dir = File.join(dir, 'canary') - elsif Rails.env.development? - dir = File.join(dir, 'dev') - end + dir = + if Gitlab::Utils.to_boolean(ENV['CANARY']) + File.join('ci_favicons', 'canary') + elsif Rails.env.development? + File.join('ci_favicons', 'dev') + else + 'ci_favicons' + end ActionController::Base.helpers.image_path(File.join(dir, "#{status.favicon}.ico")) end |