A platform for community discussion. Free, open, simple.
Prefer `update!` -> `update!`.
Guo Xiang Tan50f14c6e617a
diff --git a/lib/post_destroyer.rb b/lib/post_destroyer.rbindex 986a65a694a..11a05b60779 100644--- a/lib/post_destroyer.rb+++ b/lib/post_destroyer.rb@@ -167,7 +167,7 @@ class PostDestroyerdef make_previous_post_the_last_onelast_post = Post.where("topic_id = ? and id <> ?", @post.topic_id, @post.id).order('created_at desc').limit(1).firstif last_post.present?- @post.topic.update_attributes(+ @post.topic.update!(last_posted_at: last_post.created_at,last_post_user_id: last_post.user_id,highest_post_number: last_post.post_number