summaryrefslogtreecommitdiff
path: root/app/controllers/projects/builds_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/builds_controller.rb')
-rw-r--r--app/controllers/projects/builds_controller.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb
index 4638f77b887..26ba12520c7 100644
--- a/app/controllers/projects/builds_controller.rb
+++ b/app/controllers/projects/builds_controller.rb
@@ -1,5 +1,4 @@
class Projects::BuildsController < Projects::ApplicationController
- before_action :ci_project
before_action :build, except: [:index, :cancel_all]
before_action :authorize_manage_builds!, except: [:index, :show, :status]
@@ -9,7 +8,7 @@ class Projects::BuildsController < Projects::ApplicationController
def index
@scope = params[:scope]
- @all_builds = project.ci_builds
+ @all_builds = project.builds
@builds = @all_builds.order('created_at DESC')
@builds =
case @scope
@@ -24,13 +23,13 @@ class Projects::BuildsController < Projects::ApplicationController
end
def cancel_all
- @project.ci_builds.running_or_pending.each(&:cancel)
+ @project.builds.running_or_pending.each(&:cancel)
redirect_to namespace_project_builds_path(project.namespace, project)
end
def show
- @builds = @ci_project.commits.find_by_sha(@build.sha).builds.order('id DESC')
+ @builds = @project.ci_commits.find_by_sha(@build.sha).builds.order('id DESC')
@builds = @builds.where("id not in (?)", @build.id)
@commit = @build.commit
@@ -77,7 +76,7 @@ class Projects::BuildsController < Projects::ApplicationController
private
def build
- @build ||= ci_project.builds.unscoped.find_by!(id: params[:id])
+ @build ||= project.builds.unscoped.find_by!(id: params[:id])
end
def artifacts_file
@@ -85,7 +84,7 @@ class Projects::BuildsController < Projects::ApplicationController
end
def build_path(build)
- namespace_project_build_path(build.gl_project.namespace, build.gl_project, build)
+ namespace_project_build_path(build.project.namespace, build.project, build)
end
def authorize_manage_builds!