@@ -42,7 +42,9 class Document < ActiveRecord::Base | |||
|
42 | 42 | def initialize(attributes=nil, *args) |
|
43 | 43 | super |
|
44 | 44 | if new_record? |
|
45 | self.category ||= DocumentCategory.default | |
|
45 | # Rails3 use this instead | |
|
46 | # self.category ||= DocumentCategory.default | |
|
47 | self.category_id = DocumentCategory.default.id if self.category_id == 0 | |
|
46 | 48 | end |
|
47 | 49 | end |
|
48 | 50 |
General Comments 0
You need to be logged in to leave comments.
Login now