parent
10a1173004
commit
7b4be7f7e8
@ -1,22 +0,0 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# |
||||
# Copyright (C) 2012-2013 the OpenProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# See doc/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
class DocumentCategory < Enumeration |
||||
generator_for :name, :method => :next_name |
||||
generator_for :type => 'DocumentCategory' |
||||
|
||||
def self.next_name |
||||
@last_name ||= 'DocumentCategory0' |
||||
@last_name.succ! |
||||
@last_name |
||||
end |
||||
end |
@ -1,21 +0,0 @@ |
||||
#-- encoding: UTF-8 |
||||
#-- copyright |
||||
# OpenProject is a project management system. |
||||
# |
||||
# Copyright (C) 2012-2013 the OpenProject Team |
||||
# |
||||
# This program is free software; you can redistribute it and/or |
||||
# modify it under the terms of the GNU General Public License version 3. |
||||
# |
||||
# See doc/COPYRIGHT.rdoc for more details. |
||||
#++ |
||||
|
||||
class Document < ActiveRecord::Base |
||||
generator_for :title, :method => :next_title |
||||
|
||||
def self.next_title |
||||
@last_title ||= 'Document001' |
||||
@last_title.succ! |
||||
@last_title |
||||
end |
||||
end |
Loading…
Reference in new issue