From 3577b57f6b03a0d3c3d32daab6dc6ccf5f6e45f7 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 3 Jun 2016 13:09:49 +0200 Subject: Try to use `pipeline` where applicable --- app/models/ci/build.rb | 12 ++++++------ app/models/commit_status.rb | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 74441eb97dc..77837e9384a 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -118,12 +118,12 @@ module Ci .reorder(iid: :asc) merge_requests.find do |merge_request| - merge_request.commits.any? { |ci| ci.id == commit.sha } + merge_request.commits.any? { |ci| ci.id == pipeline.sha } end end def project_id - commit.project.id + pipeline.project_id end def project_name @@ -359,8 +359,8 @@ module Ci end def global_yaml_variables - if commit.config_processor - commit.config_processor.global_variables.map do |key, value| + if pipeline.config_processor + pipeline.config_processor.global_variables.map do |key, value| { key: key, value: value, public: true } end else @@ -369,8 +369,8 @@ module Ci end def job_yaml_variables - if commit.config_processor - commit.config_processor.job_variables(name).map do |key, value| + if pipeline.config_processor + pipeline.config_processor.job_variables(name).map do |key, value| { key: key, value: value, public: true } end else diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 3752bf09f16..98a8b541e96 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -55,7 +55,7 @@ class CommitStatus < ActiveRecord::Base delegate :sha, :short_sha, to: :commit def before_sha - commit.before_sha || Gitlab::Git::BLANK_SHA + pipeline.before_sha || Gitlab::Git::BLANK_SHA end def self.stages -- cgit v1.2.3