diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-10-12 16:21:01 +0300 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-10-14 12:07:50 +0300 |
commit | 35e2315a66e34f290230720cfa74240fd5532970 (patch) | |
tree | bd390ac1bd937a2899c0d7534e5cf368698f6340 /app/models/environment.rb | |
parent | 4b40027b50a2be4bad76b0a4a6a5e92c0de14255 (diff) |
Minor style improvement
Diffstat (limited to 'app/models/environment.rb')
-rw-r--r-- | app/models/environment.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb index c6cae81ce6a..d970bc0a005 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -53,11 +53,17 @@ class Environment < ActiveRecord::Base return nil unless ref - deployment_id = ref.split('/').last.to_i + deployment_id = ref.split('/').last deployments.find(deployment_id) end def ref_path "refs/environments/#{Shellwords.shellescape(name)}" end + + def formatted_external_url + return nil unless external_url + + external_url.gsub(/\A.*?:\/\//, '') + end end |