Project identifier is now used in URLs (instead of project id).

URLs with a project id will still be recognized.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1007 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-12-17 21:00:56 +00:00
parent b4eafd9ea8
commit 524cd689cf
9 changed files with 41 additions and 19 deletions
+14
View File
@@ -111,6 +111,20 @@ class Project < ActiveRecord::Base
end
end
def self.find(*args)
if args.first && args.first.is_a?(String) && !args.first.match(/^\d*$/)
project = find_by_identifier(*args)
raise ActiveRecord::RecordNotFound, "Couldn't find Project with identifier=#{args.first}" if project.nil?
project
else
super
end
end
def to_param
identifier
end
def active?
self.status == STATUS_ACTIVE
end