Add length validations for string fields (#24283).

Patch by Felix Schäfer.

git-svn-id: http://svn.redmine.org/redmine/trunk@15989 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2016-11-19 11:13:41 +00:00
parent e610fda877
commit 7b3f2b51c0
6 changed files with 7 additions and 1 deletions

View File

@@ -35,7 +35,7 @@ class Version < ActiveRecord::Base
validates_presence_of :name
validates_uniqueness_of :name, :scope => [:project_id]
validates_length_of :name, :maximum => 60
validates_length_of :description, :maximum => 255
validates_length_of :description, :wiki_page_title, :maximum => 255
validates :effective_date, :date => true
validates_inclusion_of :status, :in => VERSION_STATUSES
validates_inclusion_of :sharing, :in => VERSION_SHARINGS