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

Change case insensitive validations to false

Oliver Günther18e4ed1a9a2e
diff --git a/app/models/category.rb b/app/models/category.rb
index a905aacdcbc..1db15e12455 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -33,7 +33,7 @@ class Category < ActiveRecord::Base
has_many :work_packages, foreign_key: 'category_id', dependent: :nullify
validates :name,
- uniqueness: { scope: [:project_id], case_sensitive: true },
+ uniqueness: { scope: [:project_id], case_sensitive: false },
length: { maximum: 255 }
# validates that assignee is member of the issue category's project
diff --git a/app/models/enumeration.rb b/app/models/enumeration.rb
index ea7ac137ab2..7c9c4cdd436 100644
--- a/app/models/enumeration.rb
+++ b/app/models/enumeration.rb
@@ -40,7 +40,9 @@ class Enumeration < ActiveRecord::Base
before_destroy :check_integrity
validates_presence_of :name
- validates_uniqueness_of :name, scope: %i(type project_id)
+ validates_uniqueness_of :name,
+ scope: %i(type project_id),
+ case_sensitive: false
validates_length_of :name, maximum: 30
scope :shared, -> { where(project_id: nil) }
diff --git a/app/models/type.rb b/app/models/type.rb
index 070b350dcd4..1a86a8d99af 100644
--- a/app/models/type.rb
+++ b/app/models/type.rb
@@ -59,7 +59,7 @@ class ::Type < ActiveRecord::Base
validates :name,
presence: true,
- uniqueness: { case_sensitive: true },
+ uniqueness: { case_sensitive: false },
length: { maximum: 255 }
validates_inclusion_of :is_default, :is_milestone, in: [true, false]
diff --git a/app/models/version.rb b/app/models/version.rb
index 2b673d96ab8..e74e12ee0ae 100644
--- a/app/models/version.rb
+++ b/app/models/version.rb
@@ -41,7 +41,7 @@ class Version < ActiveRecord::Base
validates :name,
presence: true,
- uniqueness: { scope: [:project_id], case_sensitive: true }
+ uniqueness: { scope: [:project_id], case_sensitive: false }
validates_format_of :effective_date, with: /\A\d{4}-\d{2}-\d{2}\z/, message: :not_a_date, allow_nil: true
validates_format_of :start_date, with: /\A\d{4}-\d{2}-\d{2}\z/, message: :not_a_date, allow_nil: true