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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Move the AM:Validations out of the model to the Contract
Marcello Rocha3a8b9bc05679
diff --git a/app/contracts/work_package_types/create_contract.rb b/app/contracts/work_package_types/create_contract.rbindex 357e29c653e..4e7ebd60249 100644--- a/app/contracts/work_package_types/create_contract.rb+++ b/app/contracts/work_package_types/create_contract.rb@@ -37,6 +37,7 @@ module WorkPackageTypesattribute :is_milestoneattribute :name- validates :is_in_roadmap, inclusion: { in: [true, false] }+ validates :name, presence: true, length: { maximum: 255 }+ validates :is_default, :is_milestone, :is_in_roadmap, inclusion: { in: [true, false] }endenddiff --git a/app/models/type.rb b/app/models/type.rbindex 6c3020bf00a..2bbd17aefda 100644--- a/app/models/type.rb+++ b/app/models/type.rb@@ -61,8 +61,7 @@ class Type < ApplicationRecordacts_as_list- validates :name, presence: true, uniqueness: { case_sensitive: false }, length: { maximum: 255 }- validates :is_default, :is_milestone, inclusion: { in: [true, false] }+ validates :name, uniqueness: { case_sensitive: false }scopes :milestone