BigW Consortium Gitlab

Commit 579090c3 by gfyoung

Require projects before creating milestone

parent f3231d0f
...@@ -58,7 +58,7 @@ class Groups::MilestonesController < Groups::ApplicationController ...@@ -58,7 +58,7 @@ class Groups::MilestonesController < Groups::ApplicationController
def render_new_with_error(empty_project_ids) def render_new_with_error(empty_project_ids)
@milestone = Milestone.new(milestone_params) @milestone = Milestone.new(milestone_params)
@milestone.errors.add(:project_id, "Please select at least one project.") if empty_project_ids @milestone.errors.add(:base, "Please select at least one project.") if empty_project_ids
render :new render :new
end end
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
= f.label :projects, "Projects", class: "control-label" = f.label :projects, "Projects", class: "control-label"
.col-sm-10 .col-sm-10
= f.collection_select :project_ids, @group.projects.non_archived, :id, :name, = f.collection_select :project_ids, @group.projects.non_archived, :id, :name,
{ selected: @group.projects.non_archived.pluck(:id) }, multiple: true, class: 'select2' { selected: @group.projects.non_archived.pluck(:id) }, required: true, multiple: true, class: 'select2'
.col-md-6 .col-md-6
.form-group .form-group
......
---
title: Require projects before creating milestone.
merge_request: 7301
author: gfyoung
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