Patch #712 ยป issue-711.patch
| app/models/version.rb (working copy) | ||
|---|---|---|
|
validates_presence_of :name
|
||
|
validates_uniqueness_of :name, :scope => [:project_id]
|
||
|
validates_length_of :name, :maximum => 30
|
||
|
validates_length_of :name, :maximum => 60
|
||
|
validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :activerecord_error_not_a_date, :allow_nil => true
|
||
|
|
||
|
def start_date
|
||
| app/views/versions/_form.rhtml (working copy) | ||
|---|---|---|
|
<%= error_messages_for 'version' %>
|
||
|
<div class="box">
|
||
|
<p><%= f.text_field :name, :size => 20, :required => true %></p>
|
||
|
<p><%= f.text_field :name, :size => 40, :required => true %></p>
|
||
|
<p><%= f.text_field :description, :size => 60 %></p>
|
||
|
<p><%= f.text_field :wiki_page_title, :label => :label_wiki_page, :size => 60, :disabled => @project.wiki.nil? %></p>
|
||
|
<p><%= f.text_field :effective_date, :size => 10 %><%= calendar_for('version_effective_date') %></p>
|
||
| db/migrate/1003_allow_longer_version_name.rb (revision 0) | ||
|---|---|---|
|
class AllowLongerVersionName < ActiveRecord::Migration
|
||
|
def self.up
|
||
|
change_column :versions, :name, :string, :limit => 60
|
||
|
end
|
||
|
|
||
|
def self.down
|
||
|
change_column :versions, :name, :string, :limit => 30
|
||
|
end
|
||
|
end
|
||