summaryrefslogtreecommitdiff
path: root/app/models/ci/commit.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-14 11:28:49 +0100
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-14 11:28:49 +0100
commitb8f67c5e4735eb25a3d03daeb95900dc87692123 (patch)
treeef00cb4394ca45563636fd49b5a9378f117e9d49 /app/models/ci/commit.rb
parent2dafec91dd542ac641fea4750bf8fd68211a58af (diff)
downloadgitlab-ce-b8f67c5e4735eb25a3d03daeb95900dc87692123.tar.gz
Do not display ci build status if builds enabled but no `.gitlab-ci.yml`
Ref #3827
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r--app/models/ci/commit.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index 75465685e98..fca18ba79be 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -220,6 +220,16 @@ module Ci
update!(committed_at: DateTime.now)
end
+ ##
+ # This method checks if build status should be displayed.
+ #
+ # Build status should be available only if builds are enabled
+ # on project level and `.gitlab-ci.yml` file is present.
+ #
+ def show_build_status?
+ gl_project.builds_enabled? && ci_yaml_file
+ end
+
private
def save_yaml_error(error)