删除父评论,也删除子评论
This commit is contained in:
parent
b34be88d62
commit
f4a31cc84a
|
@ -53,6 +53,7 @@ class JournalsController < ApplicationController
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
if @journal.destroy #如果有子评论,子评论删除吗?
|
if @journal.destroy #如果有子评论,子评论删除吗?
|
||||||
|
Journal.children_journals(@journal.id).destroy_all
|
||||||
normal_status(0, "评论删除成功")
|
normal_status(0, "评论删除成功")
|
||||||
else
|
else
|
||||||
normal_status(-1, "评论删除失败")
|
normal_status(-1, "评论删除失败")
|
||||||
|
|
Loading…
Reference in New Issue