Fixed: default category ignored when adding a document (#2328).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2124 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2008-12-12 13:49:14 +00:00
1 parent c651184998
commit b21b6c365c
4 files changed
+53

No files matched your search

+6
View File
@@ -28,4 +28,10 @@ class Document < ActiveRecord::Base
validates_presence_of :project, :title, :category
validates_length_of :title, :maximum => 60
def after_initialize
if new_record?
self.category ||= Enumeration.default('DCAT')
end
end
end