diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-08-25 14:00:45 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-08-25 14:00:45 +0300 |
commit | 99dddac55850fed68ea6f66363c3f083bd4866fa (patch) | |
tree | 05075e8e498f3fe511af496bfc687f163b0fa09f /lib/gitlab/ci/config | |
parent | 946e8d3a93eb8c9e30d1f3baa3b5b28e6c06fbc1 (diff) |
Simplify ci config entry validator implementation
Diffstat (limited to 'lib/gitlab/ci/config')
-rw-r--r-- | lib/gitlab/ci/config/entry/validator.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/gitlab/ci/config/entry/validator.rb b/lib/gitlab/ci/config/entry/validator.rb index 5ab54d7e218..83bca0d08bc 100644 --- a/lib/gitlab/ci/config/entry/validator.rb +++ b/lib/gitlab/ci/config/entry/validator.rb @@ -24,16 +24,11 @@ module Gitlab private def location - predecessors = ancestors.map(&:key).compact - predecessors.append(key_name).join(':') + ancestors.map(&:key).compact.append(key_name).join(':') end def key_name - if key.blank? - @entry.class.name.to_s.demodulize.underscore.humanize - else - key - end + key.presence || @entry.class.name.to_s.demodulize.underscore.humanize end end end |