Adds an option to generate sequential project identifiers.

Disabled by default, it can be enabled on the 'Projects' tab in application settings.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1777 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2008-08-31 12:59:57 +00:00
1 parent 25b4139028
commit dbad26c87d
34 files changed
+60 -3

No files matched your search

+6
View File
@@ -238,6 +238,12 @@ class Project < ActiveRecord::Base
enabled_modules << EnabledModule.new(:name => name.to_s)
end
end
# Returns an auto-generated project identifier based on the last identifier used
def self.next_identifier
p = Project.find(:first, :order => 'created_on DESC')
p.nil? ? nil : p.identifier.to_s.succ
end
protected
def validate