summaryrefslogtreecommitdiffstats
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2015-09-20 11:50:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2015-09-20 11:50:21 +0000
commiteb57fa4847dab2bdc0026ef86ad6ade0f8a5b1cf (patch)
treefd33d7addde5479c585915003df35053e204d8b3 /app/models/project.rb
parent671fce04dec6c27b8089bc7492cb67bbf4e6277c (diff)
downloadredmine-eb57fa4847dab2bdc0026ef86ad6ade0f8a5b1cf.tar.gz
redmine-eb57fa4847dab2bdc0026ef86ad6ade0f8a5b1cf.zip
Fixed invalid search link on the new project form (#20565).
git-svn-id: http://svn.redmine.org/redmine/trunk@14614 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 25f0d3fc5..2138773cf 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -332,8 +332,12 @@ class Project < ActiveRecord::Base
end
def to_param
- # id is used for projects with a numeric identifier (compatibility)
- @to_param ||= (identifier.to_s =~ %r{^\d*$} ? id.to_s : identifier)
+ if new_record?
+ nil
+ else
+ # id is used for projects with a numeric identifier (compatibility)
+ @to_param ||= (identifier.to_s =~ %r{^\d*$} ? id.to_s : identifier)
+ end
end
def active?