2016-07-28 68 views

回答

2

你應該可以在你的用戶模型中做這樣的事情。它將基本上級聯刪除用戶後刪除。

has_many :posts, :dependent => :destroy 
+0

先回答。 – jasonleonhard

0

你可以做這樣的事情進行的刪除操作前你可以先找到用戶的相關文章並刪除它們。然後,您可以刪除用戶。