From ba142b84c73a24344a47aa5b36f73591088b85e6 Mon Sep 17 00:00:00 2001 From: Hiro Asari Date: Fri, 4 Mar 2016 09:04:58 -1000 Subject: [PATCH] Put debug options in debug_otions This depends on https://github.com/travis-ci/travis-migrations/pull/7 --- lib/travis/api/v3/models/job.rb | 3 ++- lib/travis/api/v3/services/job/debug.rb | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/travis/api/v3/models/job.rb b/lib/travis/api/v3/models/job.rb index 852f515c..f8f9bfb4 100644 --- a/lib/travis/api/v3/models/job.rb +++ b/lib/travis/api/v3/models/job.rb @@ -2,12 +2,13 @@ module Travis::API::V3 class Models::Job < Model self.inheritance_column = :_type_disabled - + has_one :log, dependent: :destroy belongs_to :repository belongs_to :commit belongs_to :build, autosave: true, foreign_key: 'source_id' belongs_to :owner, polymorphic: true serialize :config + serialize :debug_options end end diff --git a/lib/travis/api/v3/services/job/debug.rb b/lib/travis/api/v3/services/job/debug.rb index 7dd1c280..63c1939c 100644 --- a/lib/travis/api/v3/services/job/debug.rb +++ b/lib/travis/api/v3/services/job/debug.rb @@ -10,7 +10,7 @@ module Travis::API::V3 raise WrongCredentials unless Travis.config.debug_tools_enabled or Travis::Features.active?(:debug_tools, job.repository) access_control.permissions(job).debug! - job.config.merge! debug_data + job.debug_options = debug_data job.save! query.restart(access_control.user) @@ -19,12 +19,10 @@ module Travis::API::V3 def debug_data { - debug: { - stage: 'before_install', - previous_state: job.state, - created_by: access_control.user.login, - quiet: params["quiet"] || false - } + stage: 'before_install', + previous_state: job.state, + created_by: access_control.user.login, + quiet: params["quiet"] || false } end end