Resourcified enumerations.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8189 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class Enumeration < ActiveRecord::Base
|
||||
include Redmine::SubclassFactory
|
||||
|
||||
default_scope :order => "#{Enumeration.table_name}.position ASC"
|
||||
|
||||
belongs_to :project
|
||||
@@ -27,6 +29,8 @@ class Enumeration < ActiveRecord::Base
|
||||
before_destroy :check_integrity
|
||||
before_save :check_default
|
||||
|
||||
attr_protected :type
|
||||
|
||||
validates_presence_of :name
|
||||
validates_uniqueness_of :name, :scope => [:type, :project_id]
|
||||
validates_length_of :name, :maximum => 30
|
||||
|
||||
Reference in New Issue
Block a user