]> source.dussan.org Git - redmine.git/commitdiff
Raises maximum length of category name to 60 (#20991).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 21 Oct 2015 18:52:12 +0000 (18:52 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 21 Oct 2015 18:52:12 +0000 (18:52 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@14724 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue_category.rb
app/views/issue_categories/_form.html.erb
db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb [new file with mode: 0644]

index a84c5350cbc8886a6face76964d7124ea99da419..db8823ee28958fdbe667e8d577c99daa6231fef5 100644 (file)
@@ -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'
index c3b20936c1781b40be4712b30adcf7d99101dddc..8a55d9eee20b96c5947bebc753a934b52b2f9b68 100644 (file)
@@ -1,6 +1,6 @@
 <%= error_messages_for 'category' %>
 
 <div class="box tabular">
-<p><%= f.text_field :name, :size => 30, :required => true %></p>
+<p><%= f.text_field :name, :size => 60, :required => true %></p>
 <p><%= f.select :assigned_to_id, principals_options_for_select(@project.assignable_users, @category.assigned_to), :include_blank => true %></p>
 </div>
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 (file)
index 0000000..b9c971e
--- /dev/null
@@ -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