diff options
Diffstat (limited to 'app/models/document.rb')
-rw-r--r-- | app/models/document.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/document.rb b/app/models/document.rb index 95c3a52c8..2ec99fe07 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -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 |