Project

General

Profile

Patch #712 ยป issue-711.patch

Matt Pangaro, 2008-02-22 05:40

View differences:

app/models/version.rb (working copy)
23 23

  
24 24
  validates_presence_of :name
25 25
  validates_uniqueness_of :name, :scope => [:project_id]
26
  validates_length_of :name, :maximum => 30
26
  validates_length_of :name, :maximum => 60
27 27
  validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :activerecord_error_not_a_date, :allow_nil => true
28 28
  
29 29
  def start_date
app/views/versions/_form.rhtml (working copy)
1 1
<%= error_messages_for 'version' %>
2 2

  
3 3
<div class="box">
4
<p><%= f.text_field :name, :size => 20, :required => true %></p>
4
<p><%= f.text_field :name, :size => 40, :required => true %></p>
5 5
<p><%= f.text_field :description, :size => 60 %></p>
6 6
<p><%= f.text_field :wiki_page_title, :label => :label_wiki_page, :size => 60, :disabled => @project.wiki.nil? %></p>
7 7
<p><%= f.text_field :effective_date, :size => 10 %><%= calendar_for('version_effective_date') %></p>
db/migrate/1003_allow_longer_version_name.rb (revision 0)
1
class AllowLongerVersionName < ActiveRecord::Migration
2
  def self.up
3
    change_column :versions, :name, :string, :limit => 60
4
  end
5

  
6
  def self.down
7
    change_column :versions, :name, :string, :limit => 30
8
  end
9
end
    (1-1/1)