Commit 96a53e4f authored by Sean Carroll's avatar Sean Carroll Committed by Stan Hu

Make name an optional parameter of releases

This removes the validation for the name, which enables legacy releases
that omitted this value to be imported again.

Closes #31868
parent 103c3862
Pipeline #83030742 passed with stages
in 104 minutes and 39 seconds
......@@ -22,7 +22,6 @@ class Release < ApplicationRecord
accepts_nested_attributes_for :links, allow_destroy: true
validates :description, :project, :tag, presence: true
validates :name, presence: true, on: :create
validates_associated :milestone_releases, message: -> (_, obj) { obj[:value].map(&:errors).map(&:full_messages).join(",") }
scope :sorted, -> { order(released_at: :desc) }
......
---
title: Make name an optional parameter of releases
merge_request: 16647
author:
type: changed
......@@ -20,7 +20,6 @@ RSpec.describe Release do
describe 'validation' do
it { is_expected.to validate_presence_of(:project) }
it { is_expected.to validate_presence_of(:description) }
it { is_expected.to validate_presence_of(:name) }
context 'when a release exists in the database without a name' do
it 'does not require name' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment