@@ -32,6 +32,7 class CustomField < ActiveRecord::Base | |||
|
32 | 32 | validates_presence_of :name, :field_format |
|
33 | 33 | validates_uniqueness_of :name, :scope => :type |
|
34 | 34 | validates_length_of :name, :maximum => 30 |
|
35 | validates_length_of :regexp, maximum: 30 | |
|
35 | 36 | validates_inclusion_of :field_format, :in => Proc.new { Redmine::FieldFormat.available_formats } |
|
36 | 37 | validate :validate_custom_field |
|
37 | 38 | attr_protected :id |
@@ -37,7 +37,9 class Repository < ActiveRecord::Base | |||
|
37 | 37 | # has_many :changesets, :dependent => :destroy is too slow for big repositories |
|
38 | 38 | before_destroy :clear_changesets |
|
39 | 39 | |
|
40 | validates_length_of :login, maximum: 60, allow_nil: true | |
|
40 | 41 | validates_length_of :password, :maximum => 255, :allow_nil => true |
|
42 | validates_length_of :root_url, :url, maximum: 255 | |
|
41 | 43 | validates_length_of :identifier, :maximum => IDENTIFIER_MAX_LENGTH, :allow_blank => true |
|
42 | 44 | validates_uniqueness_of :identifier, :scope => :project_id |
|
43 | 45 | validates_exclusion_of :identifier, :in => %w(browse show entry raw changes annotate diff statistics graph revisions revision) |
@@ -111,6 +111,7 class User < Principal | |||
|
111 | 111 | validates_format_of :login, :with => /\A[a-z0-9_\-@\.]*\z/i |
|
112 | 112 | validates_length_of :login, :maximum => LOGIN_LENGTH_LIMIT |
|
113 | 113 | validates_length_of :firstname, :lastname, :maximum => 30 |
|
114 | validates_length_of :identity_url, maximum: 255 | |
|
114 | 115 | validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true |
|
115 | 116 | validate :validate_password_length |
|
116 | 117 | validate do |
@@ -35,7 +35,7 class Version < ActiveRecord::Base | |||
|
35 | 35 | validates_presence_of :name |
|
36 | 36 | validates_uniqueness_of :name, :scope => [:project_id] |
|
37 | 37 | validates_length_of :name, :maximum => 60 |
|
38 | validates_length_of :description, :maximum => 255 | |
|
38 | validates_length_of :description, :wiki_page_title, :maximum => 255 | |
|
39 | 39 | validates :effective_date, :date => true |
|
40 | 40 | validates_inclusion_of :status, :in => VERSION_STATUSES |
|
41 | 41 | validates_inclusion_of :sharing, :in => VERSION_SHARINGS |
@@ -25,6 +25,7 class Wiki < ActiveRecord::Base | |||
|
25 | 25 | |
|
26 | 26 | validates_presence_of :start_page |
|
27 | 27 | validates_format_of :start_page, :with => /\A[^,\.\/\?\;\|\:]*\z/ |
|
28 | validates_length_of :title, maximum: 255 | |
|
28 | 29 | attr_protected :id |
|
29 | 30 | |
|
30 | 31 | before_destroy :delete_redirects |
@@ -45,6 +45,7 class WikiPage < ActiveRecord::Base | |||
|
45 | 45 | validates_presence_of :title |
|
46 | 46 | validates_format_of :title, :with => /\A[^,\.\/\?\;\|\s]*\z/ |
|
47 | 47 | validates_uniqueness_of :title, :scope => :wiki_id, :case_sensitive => false |
|
48 | validates_length_of :title, maximum: 255 | |
|
48 | 49 | validates_associated :content |
|
49 | 50 | attr_protected :id |
|
50 | 51 |
General Comments 0
You need to be logged in to leave comments.
Login now