Project

General

Profile

Defect #5154 » change_name_limit.patch

Mike Stupalov, 2010-03-23 10:57

View differences:

app/models/issue_category.rb (working copy)
22 22
  
23 23
  validates_presence_of :name
24 24
  validates_uniqueness_of :name, :scope => [:project_id]
25
  validates_length_of :name, :maximum => 30
25
  validates_length_of :name, :maximum => 60
26 26
  
27 27
  alias :destroy_without_reassign :destroy
28 28
  
app/models/enumeration.rb (working copy)
28 28
  
29 29
  validates_presence_of :name
30 30
  validates_uniqueness_of :name, :scope => [:type, :project_id]
31
  validates_length_of :name, :maximum => 30
31
  validates_length_of :name, :maximum => 60
32 32

  
33 33
  named_scope :shared, :conditions => { :project_id => nil }
34 34
  named_scope :active, :conditions => { :active => true }
app/models/custom_field.rb (working copy)
31 31

  
32 32
  validates_presence_of :name, :field_format
33 33
  validates_uniqueness_of :name, :scope => :type
34
  validates_length_of :name, :maximum => 30
34
  validates_length_of :name, :maximum => 60
35 35
  validates_format_of :name, :with => /^[\w\s\.\'\-]*$/i
36 36
  validates_inclusion_of :field_format, :in => FIELD_FORMATS.keys
37 37

  
app/models/issue_status.rb (working copy)
22 22

  
23 23
  validates_presence_of :name
24 24
  validates_uniqueness_of :name
25
  validates_length_of :name, :maximum => 30
25
  validates_length_of :name, :maximum => 60
26 26
  validates_format_of :name, :with => /^[\w\s\'\-]*$/i
27 27
  validates_inclusion_of :default_done_ratio, :in => 0..100, :allow_nil => true
28 28

  
app/models/tracker.rb (working copy)
30 30

  
31 31
  validates_presence_of :name
32 32
  validates_uniqueness_of :name
33
  validates_length_of :name, :maximum => 30
33
  validates_length_of :name, :maximum => 60
34 34
  validates_format_of :name, :with => /^[\w\s\'\-]*$/i
35 35

  
36 36
  def to_s; name end
app/models/role.rb (working copy)
42 42

  
43 43
  validates_presence_of :name
44 44
  validates_uniqueness_of :name
45
  validates_length_of :name, :maximum => 30
45
  validates_length_of :name, :maximum => 60
46 46
  validates_format_of :name, :with => /^[\w\s\'\-]*$/i
47 47

  
48 48
  def permissions
app/models/project.rb (working copy)
66 66
  validates_presence_of :name, :identifier
67 67
  validates_uniqueness_of :name, :identifier
68 68
  validates_associated :repository, :wiki
69
  validates_length_of :name, :maximum => 30
69
  validates_length_of :name, :maximum => 60
70 70
  validates_length_of :homepage, :maximum => 255
71 71
  validates_length_of :identifier, :in => 1..20
72 72
  # donwcase letters, digits, dashes but not digits only
db/migrate/20100323105501_change_name_limit.rb (revision 0)
1
class ChangeNameLimit < ActiveRecord::Migration
2
  def self.up
3
    change_column :auth_sources, :name, :string, :limit => nil
4
    change_column :custom_fields, :name, :string, :limit => nil
5
    change_column :enumerations, :name, :string, :limit => nil
6
    change_column :issue_categories, :name, :string, :limit => nil
7
    change_column :issue_statuses, :name, :string, :limit => nil
8
    change_column :projects, :name, :string, :limit => nil
9
    change_column :roles, :name, :string, :limit => nil
10
    change_column :trackers, :name, :string, :limit => nil
11
  end
12

  
13
  def self.down
14
    change_column :auth_sources, :name, :string, :limit => 60
15
    change_column :custom_fields, :name, :string, :limit => 30
16
    change_column :enumerations, :name, :string, :limit => 30
17
    change_column :issue_categories, :name, :string, :limit => 30
18
    change_column :issue_statuses, :name, :string, :limit => 30
19
    change_column :projects, :name, :string, :limit => 30
20
    change_column :roles, :name, :string, :limit => 30
21
    change_column :trackers, :name, :string, :limit => 30
22
  end
23
end
(2-2/2)