[#975] Validate and enable editing of Version start date

This commit is contained in:
Spenser Jones 2012-04-10 21:51:18 +00:00 committed by Holger Just
parent c3fc106355
commit e6c79ddef4
1 changed files with 2 additions and 1 deletions

View File

@ -27,7 +27,7 @@ class Version < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name, :scope => [:project_id]
validates_length_of :name, :maximum => 60
validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :not_a_date, :allow_nil => true
validates_format_of :start_date, :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :not_a_date, :allow_nil => true
validates_inclusion_of :status, :in => VERSION_STATUSES
validates_inclusion_of :sharing, :in => VERSION_SHARINGS
@ -37,6 +37,7 @@ class Version < ActiveRecord::Base
safe_attributes 'name',
'description',
'start_date',
'effective_date',
'due_date',
'wiki_page_title',