Patch #1789 ยป change_project_name_length_limit_to_35-r1745.patch
| app/models/project.rb (working copy) | ||
|---|---|---|
|
validates_presence_of :name, :identifier
|
||
|
validates_uniqueness_of :name, :identifier
|
||
|
validates_associated :repository, :wiki
|
||
|
validates_length_of :name, :maximum => 30
|
||
|
validates_length_of :name, :maximum => 35
|
||
|
validates_length_of :homepage, :maximum => 255
|
||
|
validates_length_of :identifier, :in => 3..20
|
||
|
validates_format_of :identifier, :with => /^[a-z0-9\-]*$/
|
||
| app/views/projects/_form.rhtml (working copy) | ||
|---|---|---|
|
<div class="box">
|
||
|
<!--[form:project]-->
|
||
|
<p><%= f.text_field :name, :required => true %><br /><em><%= l(:text_caracters_maximum, 30) %></em></p>
|
||
|
<p><%= f.text_field :name, :required => true %><br /><em><%= l(:text_caracters_maximum, 35) %></em></p>
|
||
|
<% if User.current.admin? and !@root_projects.empty? %>
|
||
|
<p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
|
||
| db/migrate/096_change_project_name_length_limit.rb (revision 0) | ||
|---|---|---|
|
class ChangeProjectNameLengthLimit < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
change_column :projects, :name, :string, :limit => 35
|
||
|
end
|
||
|
|
||
|
def self.down
|
||
|
change_column :projects, :name, :string, :limit => 30
|
||
|
end
|
||
|
end
|
||