summaryrefslogtreecommitdiff
path: root/app/controllers/projects
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-04-11 16:55:40 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-04-11 23:32:55 +0200
commitaf7214d0f077f738ed57194feb0cd468c43d4310 (patch)
tree36c2d2abd7252af8a4610f22affa92f8f2b2e1e5 /app/controllers/projects
parent5d69f5b46d475f34fb71dfb4e8b683e90897f1da (diff)
downloadgitlab-ce-af7214d0f077f738ed57194feb0cd468c43d4310.tar.gz
Fix specs
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/commit_controller.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb
index f9a4aeaa627..72078c3cc68 100644
--- a/app/controllers/projects/commit_controller.rb
+++ b/app/controllers/projects/commit_controller.rb
@@ -38,13 +38,13 @@ class Projects::CommitController < Projects::ApplicationController
end
def cancel_builds
- ci_commit.builds.running_or_pending.each(&:cancel)
+ ci_builds.running_or_pending.each(&:cancel)
redirect_back_or_default default: builds_namespace_project_commit_path(project.namespace, project, commit.sha)
end
def retry_builds
- ci_commit.builds.latest.failed.each do |build|
+ ci_builds.latest.failed.each do |build|
if build.retryable?
Ci::Build.retry(build)
end
@@ -98,6 +98,10 @@ class Projects::CommitController < Projects::ApplicationController
@ci_commits ||= project.ci_commits.where(sha: commit.sha)
end
+ def ci_builds
+ @ci_builds ||= Ci::Build.where(commit: ci_commits)
+ end
+
def define_show_vars
return git_not_found! unless commit