[#975] Validate and enable editing of Version start date
This commit is contained in:
parent
c3fc106355
commit
e6c79ddef4
@ -27,7 +27,7 @@ class Version < ActiveRecord::Base
|
|||||||
validates_presence_of :name
|
validates_presence_of :name
|
||||||
validates_uniqueness_of :name, :scope => [:project_id]
|
validates_uniqueness_of :name, :scope => [:project_id]
|
||||||
validates_length_of :name, :maximum => 60
|
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 :status, :in => VERSION_STATUSES
|
||||||
validates_inclusion_of :sharing, :in => VERSION_SHARINGS
|
validates_inclusion_of :sharing, :in => VERSION_SHARINGS
|
||||||
|
|
||||||
@ -37,6 +37,7 @@ class Version < ActiveRecord::Base
|
|||||||
|
|
||||||
safe_attributes 'name',
|
safe_attributes 'name',
|
||||||
'description',
|
'description',
|
||||||
|
'start_date',
|
||||||
'effective_date',
|
'effective_date',
|
||||||
'due_date',
|
'due_date',
|
||||||
'wiki_page_title',
|
'wiki_page_title',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user