Commit db2a9a28 authored by jplang's avatar jplang

Raised group name maximum length to 255 characters (#13174).

git-svn-id: https://svn.redmine.org/redmine/trunk@11392 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 202f9e96
......@@ -25,7 +25,7 @@ class Group < Principal
validates_presence_of :lastname
validates_uniqueness_of :lastname, :case_sensitive => false
validates_length_of :lastname, :maximum => 30
validates_length_of :lastname, :maximum => 255
before_destroy :remove_references_before_destroy
......
<%= error_messages_for @group %>
<div class="box tabular">
<p><%= f.text_field :name %></p>
<p><%= f.text_field :name, :required => true, :size => 60 %></p>
<% @group.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :group, value %></p>
<% end %>
......
class ChangeUsersLastnameLengthTo255 < ActiveRecord::Migration
def self.up
change_column :users, :lastname, :string, :limit => 255, :default => '', :null => false
end
def self.down
change_column :users, :lastname, :string, :limit => 30, :default => '', :null => false
end
end
......@@ -35,6 +35,14 @@ class GroupTest < ActiveSupport::TestCase
assert_equal 'New group', g.name
end
def test_name_should_accept_255_characters
name = 'a' * 255
g = Group.new(:name => name)
assert g.save
g.reload
assert_equal name, g.name
end
def test_blank_name_error_message
set_language_if_valid 'en'
g = Group.new
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment