Commit 8b0ccc0c by Rocky Duan

disabled autosave to speedup

parent 87ac5e34
...@@ -19,8 +19,8 @@ class Comment < Content ...@@ -19,8 +19,8 @@ class Comment < Content
validates_presence_of :body validates_presence_of :body
validates_presence_of :course_id # do we really need this? validates_presence_of :course_id # do we really need this?
validates_presence_of :comment_thread validates_presence_of :comment_thread, autosave: false
validates_presence_of :author validates_presence_of :author, autosave: false
before_destroy :delete_descendants # TODO async before_destroy :delete_descendants # TODO async
after_create :generate_notifications after_create :generate_notifications
......
...@@ -26,8 +26,8 @@ class CommentThread < Content ...@@ -26,8 +26,8 @@ class CommentThread < Content
end end
end end
belongs_to :author, class_name: "User", inverse_of: :comment_threads, index: true, autosave: true belongs_to :author, class_name: "User", inverse_of: :comment_threads, index: true
has_many :comments, dependent: :destroy, autosave: true# Use destroy to envoke callback on the top-level comments TODO async has_many :comments, dependent: :destroy#, autosave: true# Use destroy to envoke callback on the top-level comments TODO async
attr_accessible :title, :body, :course_id, :commentable_id, :anonymous attr_accessible :title, :body, :course_id, :commentable_id, :anonymous
...@@ -35,7 +35,7 @@ class CommentThread < Content ...@@ -35,7 +35,7 @@ class CommentThread < Content
validates_presence_of :body validates_presence_of :body
validates_presence_of :course_id # do we really need this? validates_presence_of :course_id # do we really need this?
validates_presence_of :commentable_id validates_presence_of :commentable_id
validates_presence_of :author validates_presence_of :author, autosave: false
validate :tag_names_valid validate :tag_names_valid
validate :tag_names_unique validate :tag_names_unique
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment