diff options
author | Phil Hughes <me@iamphill.com> | 2018-05-03 12:39:22 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-05-03 12:39:22 +0100 |
commit | 93f0eb07c993fa5e424b0e803e972c93e6e444c5 (patch) | |
tree | 688ef47370dc56b81058f1fbee7261d807e7cbbd /app/models/ci/pipeline.rb | |
parent | efed5aed411237ea94e9530e3033119d75f44886 (diff) | |
parent | 9b8332d324c931798c30adf5517abda96212d5c3 (diff) | |
download | gitlab-ce-93f0eb07c993fa5e424b0e803e972c93e6e444c5.tar.gz |
Merge branch '44846-improve-web-ide-left-panel-and-modes' into ide-sidebar-commit-box
Diffstat (limited to 'app/models/ci/pipeline.rb')
-rw-r--r-- | app/models/ci/pipeline.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 434b9b64c65..e1b9bc76475 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -530,6 +530,17 @@ module Ci @latest_builds_with_artifacts ||= builds.latest.with_artifacts_archive.to_a end + # Rails 5.0 autogenerated question mark enum methods return wrong result if enum value is nil. + # They always return `false`. + # These methods overwrite autogenerated ones to return correct results. + def unknown? + Gitlab.rails5? ? source.nil? : super + end + + def unknown_source? + Gitlab.rails5? ? config_source.nil? : super + end + private def ci_yaml_from_repo |