From dfcc8e1492dc4a30b1cddf600aed105f3284528d Mon Sep 17 00:00:00 2001
From: Jean-Philippe Lang
Date: Sun, 25 May 2008 13:37:29 +0000
Subject: [PATCH] Change projects homepage limit to 255 chars (#663, #1095).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1457 e93f8b46-1217-0410-a6f0-8f06a7374b81
---
app/models/project.rb | 2 +-
app/views/projects/_form.rhtml | 2 +-
db/migrate/094_change_projects_homepage_limit.rb | 9 +++++++++
3 files changed, 11 insertions(+), 2 deletions(-)
create mode 100644 db/migrate/094_change_projects_homepage_limit.rb
diff --git a/app/models/project.rb b/app/models/project.rb
index 2f2937fd9..e560f1dac 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -57,7 +57,7 @@ class Project < ActiveRecord::Base
validates_associated :custom_values, :on => :update
validates_associated :repository, :wiki
validates_length_of :name, :maximum => 30
- validates_length_of :homepage, :maximum => 60
+ validates_length_of :homepage, :maximum => 255
validates_length_of :identifier, :in => 3..20
validates_format_of :identifier, :with => /^[a-z0-9\-]*$/
diff --git a/app/views/projects/_form.rhtml b/app/views/projects/_form.rhtml
index 32e4dcd44..774e73977 100644
--- a/app/views/projects/_form.rhtml
+++ b/app/views/projects/_form.rhtml
@@ -13,7 +13,7 @@
<% unless @project.identifier_frozen? %>
<%= l(:text_length_between, 3, 20) %> <%= l(:text_project_identifier_info) %>
<% end %>
-<%= f.text_field :homepage, :size => 40 %>
+<%= f.text_field :homepage, :size => 60 %>
<%= f.check_box :is_public %>
<%= wikitoolbar_for 'project_description' %>
diff --git a/db/migrate/094_change_projects_homepage_limit.rb b/db/migrate/094_change_projects_homepage_limit.rb
new file mode 100644
index 000000000..98374aa4e
--- /dev/null
+++ b/db/migrate/094_change_projects_homepage_limit.rb
@@ -0,0 +1,9 @@
+class ChangeProjectsHomepageLimit < ActiveRecord::Migration
+ def self.up
+ change_column :projects, :homepage, :string, :limit => nil, :default => ''
+ end
+
+ def self.down
+ change_column :projects, :homepage, :string, :limit => 60, :default => ''
+ end
+end