Fix 'DEPRECATION WARNING: Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1.' (#32897).

Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@19478 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2020-01-28 09:49:14 +00:00
parent afe9b9b31d
commit 10bb12e09f
17 changed files with 18 additions and 18 deletions

View File

@@ -32,7 +32,7 @@ class Enumeration < ActiveRecord::Base
before_save :check_default
validates_presence_of :name
validates_uniqueness_of :name, :scope => [:type, :project_id]
validates_uniqueness_of :name, :scope => [:type, :project_id], :case_sensitive => false
validates_length_of :name, :maximum => 30
scope :shared, lambda { where(:project_id => nil) }