Merge branch '46049-import-export-import-is-broken-due-to-the-addition-of-a-ci-table' into 'master'

Resolve "Import/Export (import) is broken due to the addition of a CI table"

Closes #46049

See merge request gitlab-org/gitlab-ce!18745
This commit is contained in:
Douwe Maan 2018-05-04 16:00:39 +00:00
commit 0065c449ff
3 changed files with 14 additions and 1 deletions

View File

@ -234,7 +234,7 @@ class Project < ActiveRecord::Base
has_many :custom_attributes, class_name: 'ProjectCustomAttribute'
has_many :project_badges, class_name: 'ProjectBadge'
has_one :ci_cd_settings, class_name: 'ProjectCiCdSetting', inverse_of: :project, autosave: true
has_one :ci_cd_settings, class_name: 'ProjectCiCdSetting', inverse_of: :project, autosave: true, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent
accepts_nested_attributes_for :variables, allow_destroy: true
accepts_nested_attributes_for :project_feature, update_only: true

View File

@ -0,0 +1,5 @@
---
title: Resolve Import/Export ci_cd_settings error updating the project
merge_request: 46049
author:
type: fixed

View File

@ -101,6 +101,14 @@ describe Project do
end
end
context 'updating cd_cd_settings' do
it 'does not raise an error' do
project = create(:project)
expect { project.update(ci_cd_settings: nil) }.not_to raise_exception
end
end
describe '#members & #requesters' do
let(:project) { create(:project, :public, :access_requestable) }
let(:requester) { create(:user) }