Raised group name maximum length to 255 characters (#13174).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11392 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
5891a873fb
commit
ee1d9647b8
|
@ -25,7 +25,7 @@ class Group < Principal
|
||||||
|
|
||||||
validates_presence_of :lastname
|
validates_presence_of :lastname
|
||||||
validates_uniqueness_of :lastname, :case_sensitive => false
|
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
|
before_destroy :remove_references_before_destroy
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<%= error_messages_for @group %>
|
<%= error_messages_for @group %>
|
||||||
|
|
||||||
<div class="box tabular">
|
<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| %>
|
<% @group.custom_field_values.each do |value| %>
|
||||||
<p><%= custom_field_tag_with_label :group, value %></p>
|
<p><%= custom_field_tag_with_label :group, value %></p>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
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
|
assert_equal 'New group', g.name
|
||||||
end
|
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
|
def test_blank_name_error_message
|
||||||
set_language_if_valid 'en'
|
set_language_if_valid 'en'
|
||||||
g = Group.new
|
g = Group.new
|
||||||
|
|
Loading…
Reference in New Issue