From ac50f9dddfb4555a2c356454c1cbfc1cc0b37d6d Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 12 Apr 2016 10:23:31 +0200 Subject: Fix rest of rspec and spinach tests --- app/models/ci/commit.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/models/ci/commit.rb') diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index d09866a4bdf..2ab1fefe8e1 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -117,7 +117,7 @@ module Ci # get status for all prior builds prior_builds = latest_builds.reject { |other_build| next_stages.include?(other_build.stage) } - status = Ci::Status.get_status(prior_builds) + status = prior_builds.status # create builds for next stages based next_stages.any? do |stage| @@ -185,7 +185,7 @@ module Ci private def update_status - status = + self.status = if yaml_errors.present? 'failed' else @@ -194,17 +194,17 @@ module Ci end def update_started_at - started_at = + self.started_at = statuses.minimum(:started_at) end def update_finished_at - finished_at = + self.finished_at = statuses.maximum(:finished_at) end def update_duration - duration = begin + self.duration = begin duration_array = latest.map(&:duration).compact duration_array.reduce(:+).to_i end -- cgit v1.2.1