# La forma correcta de eliminar completamente cientos de temas mediante Rails?

**URL:** <https://meta.discourse.org/t/the-proper-way-to-completely-delete-hundred-of-topics-via-rails/90323>\
**Category:** Product Support\
**Created:** [20 Junio, 2018 15:52 UTC](https://meta.discourse.org/t/the-proper-way-to-completely-delete-hundred-of-topics-via-rails/90323 "2018-06-20T15:52:40Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [21 Junio, 2018 05:18 UTC](https://meta.discourse.org/t/the-proper-way-to-completely-delete-hundred-of-topics-via-rails/90323/3 "2018-06-21T05:18:58Z")

</div>

I would do this in batches of say 10, building up to batches of 200 depending on how long it takes.

```plaintext
Topic.where(category_id: XX).limit(20).destroy_all

```

It does cascade all stuff it needs so it could take a while.

---

_[View the full topic](https://meta.discourse.org/t/the-proper-way-to-completely-delete-hundred-of-topics-via-rails/90323)._
