Skip to content
Snippets Groups Projects
Commit 28651143 authored by Jan Provaznik's avatar Jan Provaznik
Browse files

Move name presence validation to core

Board name presence should be validated also in FOSS - this is
not EE-specific attribute.
parent 18dff9ac
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -7,6 +7,7 @@ class Board < ApplicationRecord
has_many :lists, -> { ordered }, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
has_many :destroyable_lists, -> { destroyable.ordered }, class_name: "List"
 
validates :name, presence: true
validates :project, presence: true, if: :project_needed?
validates :group, presence: true, unless: :project
 
Loading
Loading
---
title: Fixed error handling GraphQL API when issue board creation fails
merge_request: 55982
merge_request: 56467
author:
type: fixed
Loading
Loading
@@ -24,8 +24,6 @@ module Board
 
has_many :labels, through: :board_labels
 
validates :name, presence: true
scope :with_associations, -> { preload(:destroyable_lists, :labels, :assignee) }
end
 
Loading
Loading
Loading
Loading
@@ -18,10 +18,6 @@
it { is_expected.to have_many(:boards_epic_user_preferences).class_name('Boards::EpicUserPreference') }
end
 
describe 'validations' do
it { is_expected.to validate_presence_of(:name) }
end
context 'validations' do
context 'when group is present' do
subject { described_class.new(group: create(:group)) }
Loading
Loading
Loading
Loading
@@ -12,6 +12,7 @@
end
 
describe 'validations' do
it { is_expected.to validate_presence_of(:name) }
it { is_expected.to validate_presence_of(:project) }
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment