diff options
Diffstat (limited to 'app/models/document.rb')
-rw-r--r-- | app/models/document.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/document.rb b/app/models/document.rb index f8ea92a11..208b10876 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -36,7 +36,8 @@ class Document < ActiveRecord::Base !user.nil? && user.allowed_to?(:view_documents, project) end - def after_initialize + def initialize(attributes=nil, *args) + super if new_record? self.category ||= DocumentCategory.default end |