summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/document.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/document.rb b/app/models/document.rb
index d4a89ffd9..764dea7f0 100644
--- a/app/models/document.rb
+++ b/app/models/document.rb
@@ -42,7 +42,9 @@ class Document < ActiveRecord::Base
def initialize(attributes=nil, *args)
super
if new_record?
- self.category ||= DocumentCategory.default
+ # Rails3 use this instead
+ # self.category ||= DocumentCategory.default
+ self.category_id = DocumentCategory.default.id if self.category_id == 0
end
end