summaryrefslogtreecommitdiff
path: root/app/models/ci/commit.rb
diff options
context:
space:
mode:
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 d2a29236942..6bf596e5d3e 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -218,6 +218,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?
+ project.builds_enabled? && ci_yaml_file
+ end
+
private
def save_yaml_error(error)