From 05106b45ad22640039e012abbdc3c8a30040acdc Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 21 Oct 2015 18:52:12 +0000 Subject: [PATCH] Raises maximum length of category name to 60 (#20991). git-svn-id: http://svn.redmine.org/redmine/trunk@14724 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/issue_category.rb | 2 +- app/views/issue_categories/_form.html.erb | 2 +- ...021184614_change_issue_categories_name_limit_to_60.rb | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb diff --git a/app/models/issue_category.rb b/app/models/issue_category.rb index a84c5350c..db8823ee2 100644 --- a/app/models/issue_category.rb +++ b/app/models/issue_category.rb @@ -23,7 +23,7 @@ class IssueCategory < ActiveRecord::Base validates_presence_of :name validates_uniqueness_of :name, :scope => [:project_id] - validates_length_of :name, :maximum => 30 + validates_length_of :name, :maximum => 60 attr_protected :id safe_attributes 'name', 'assigned_to_id' diff --git a/app/views/issue_categories/_form.html.erb b/app/views/issue_categories/_form.html.erb index c3b20936c..8a55d9eee 100644 --- a/app/views/issue_categories/_form.html.erb +++ b/app/views/issue_categories/_form.html.erb @@ -1,6 +1,6 @@ <%= error_messages_for 'category' %>
-

<%= f.text_field :name, :size => 30, :required => true %>

+

<%= f.text_field :name, :size => 60, :required => true %>

<%= f.select :assigned_to_id, principals_options_for_select(@project.assignable_users, @category.assigned_to), :include_blank => true %>

diff --git a/db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb b/db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb new file mode 100644 index 000000000..b9c971edf --- /dev/null +++ b/db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb @@ -0,0 +1,9 @@ +class ChangeIssueCategoriesNameLimitTo60 < ActiveRecord::Migration + def self.up + change_column :issue_categories, :name, :string, :limit => 60, :default => "", :null => false + end + + def self.down + change_column :issue_categories, :name, :string, :limit => 30, :default => "", :null => false + end +end -- 2.39.5