summaryrefslogtreecommitdiffstats
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-06 11:23:05 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-12-06 11:23:05 +0000
commite09f48e45994ef342f53f965c829d591be711bcf (patch)
treec560c45ddfab168674b8cc4784a1f080dbc04a8a /app/models/project.rb
parent9c173375c631508aabcf1e65db28605410cbb9e2 (diff)
downloadredmine-e09f48e45994ef342f53f965c829d591be711bcf.tar.gz
redmine-e09f48e45994ef342f53f965c829d591be711bcf.zip
Skip some validations if attribute did not change.
git-svn-id: http://svn.redmine.org/redmine/trunk@13723 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 961fb5bfc..f7cfc65e0 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -72,8 +72,7 @@ class Project < ActiveRecord::Base
attr_protected :status
validates_presence_of :name, :identifier
- validates_uniqueness_of :identifier
- validates_associated :repository, :wiki
+ validates_uniqueness_of :identifier, :if => Proc.new {|p| p.identifier_changed?}
validates_length_of :name, :maximum => 255
validates_length_of :homepage, :maximum => 255
validates_length_of :identifier, :in => 1..IDENTIFIER_MAX_LENGTH