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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user