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
Lift name length limit of some models
Christophe Bliardfb6c2964288e
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rbindex a70407d48ea..d135358ff92 100644--- a/app/models/enumeration.rb+++ b/app/models/enumeration.rb@@ -41,7 +41,7 @@ class Enumeration < ApplicationRecordvalidates :name,uniqueness: { scope: %i(type project_id),case_sensitive: false }- validates :name, length: { maximum: 30 }+ validates :name, length: { maximum: 256 }scope :shared, -> { where(project_id: nil) }scope :active, -> { where(active: true) }diff --git a/app/models/forum.rb b/app/models/forum.rbindex caedc309ff0..8efc97e1a15 100644--- a/app/models/forum.rb+++ b/app/models/forum.rb@@ -40,7 +40,7 @@ class Forum < ApplicationRecordacts_as_watchable permission: :view_messagesvalidates :name, :description, presence: true- validates :name, length: { maximum: 30 }+ validates :name, length: { maximum: 256 }validates :description, length: { maximum: 255 }def visible?(user = User.current)diff --git a/app/models/news.rb b/app/models/news.rbindex 8e6af7bbcfe..598a1cd1e2d 100644--- a/app/models/news.rb+++ b/app/models/news.rb@@ -34,7 +34,7 @@ class News < ApplicationRecord}, as: :commented, dependent: :delete_allvalidates :title, presence: true- validates :title, length: { maximum: 60 }+ validates :title, length: { maximum: 256 }validates :summary, length: { maximum: 255 }acts_as_journalizeddiff --git a/app/models/role.rb b/app/models/role.rbindex bf341e889d6..a599c0eeec2 100644--- a/app/models/role.rb+++ b/app/models/role.rb@@ -58,7 +58,7 @@ class Role < ApplicationRecordvalidates :name,presence: true,- length: { maximum: 30 },+ length: { maximum: 256 },uniqueness: { case_sensitive: true }def self.givablediff --git a/app/models/status.rb b/app/models/status.rbindex 7ddfe7f35a4..917fce252d4 100644--- a/app/models/status.rb+++ b/app/models/status.rb@@ -41,7 +41,7 @@ class Status < ApplicationRecordvalidates :name,presence: true,uniqueness: { case_sensitive: false },- length: { maximum: 30 }+ length: { maximum: 256 }validates :default_done_ratio, inclusion: { in: 0..100, allow_nil: true }diff --git a/spec/models/global_role_spec.rb b/spec/models/global_role_spec.rbindex 955672d1e7b..18403e0797d 100644--- a/spec/models/global_role_spec.rb+++ b/spec/models/global_role_spec.rb@@ -33,7 +33,7 @@ describe GlobalRole doit { is_expected.to validate_presence_of :name }it { is_expected.to validate_uniqueness_of :name }- it { is_expected.to validate_length_of(:name).is_at_most(30) }+ it { is_expected.to validate_length_of(:name).is_at_most(256) }describe 'attributes' dobefore { @role = GlobalRole.new }