Patch #1998 ยป raise_project_identifier_length_limit_to_30-r1926.diff
| app/models/project.rb (working copy) | ||
|---|---|---|
| 58 | 58 |
validates_associated :repository, :wiki |
| 59 | 59 |
validates_length_of :name, :maximum => 30 |
| 60 | 60 |
validates_length_of :homepage, :maximum => 255 |
| 61 |
validates_length_of :identifier, :in => 3..20
|
|
| 61 |
validates_length_of :identifier, :in => 3..30
|
|
| 62 | 62 |
validates_format_of :identifier, :with => /^[a-z0-9\-]*$/ |
| 63 | 63 |
|
| 64 | 64 |
before_destroy :delete_all_members |
| app/views/projects/_form.rhtml (working copy) | ||
|---|---|---|
| 11 | 11 |
<p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p> |
| 12 | 12 |
<p><%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen? %> |
| 13 | 13 |
<% unless @project.identifier_frozen? %> |
| 14 |
<br /><em><%= l(:text_length_between, 3, 20) %> <%= l(:text_project_identifier_info) %></em>
|
|
| 14 |
<br /><em><%= l(:text_length_between, 3, 30) %> <%= l(:text_project_identifier_info) %></em>
|
|
| 15 | 15 |
<% end %></p> |
| 16 | 16 |
<p><%= f.text_field :homepage, :size => 60 %></p> |
| 17 | 17 |
<p><%= f.check_box :is_public %></p> |
| db/migrate/20081007020300_change_project_identifier_length_limit.rb (revision 0) | ||
|---|---|---|
| 1 |
class ChangeProjectIdentifierLengthLimit < ActiveRecord::Migration |
|
| 2 |
def self.up |
|
| 3 |
change_column :projects, :identifier, :string, :limit => 30 |
|
| 4 |
end |
|
| 5 |
|
|
| 6 |
def self.down |
|
| 7 |
change_column :projects, :identifier, :string, :limit => 20 |
|
| 8 |
end |
|
| 9 |
end |
|
| lib/tasks/migrate_from_mantis.rake (working copy) | ||
|---|---|---|
| 125 | 125 |
end |
| 126 | 126 |
|
| 127 | 127 |
def identifier |
| 128 |
read_attribute(:name).underscore[0..19].gsub(/[^a-z0-9\-]/, '-')
|
|
| 128 |
read_attribute(:name).underscore[0..29].gsub(/[^a-z0-9\-]/, '-')
|
|
| 129 | 129 |
end |
| 130 | 130 |
end |
| 131 | 131 |
|