Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Moves the validations to the legacy contract

Marcello Rochadd5c2a9a5b92
diff --git a/app/contracts/types/base_contract.rb b/app/contracts/types/base_contract.rb
index 5e756d68b32..8a1920e93e0 100644
--- a/app/contracts/types/base_contract.rb
+++ b/app/contracts/types/base_contract.rb
@@ -46,6 +46,9 @@ module Types
attribute :attribute_groups
attribute :patterns
+ validates :name, presence: true, length: { maximum: 255 }
+ validates :is_default, :is_milestone, :is_in_roadmap, inclusion: { in: [true, false] }
+
validate :validate_current_user_is_admin
validate :validate_attribute_group_names
validate :validate_attribute_groups