# A post's TopicEmbed isn't destroyed when the post is deleted

**URL:** <https://meta.discourse.org/t/a-posts-topicembed-isnt-destroyed-when-the-post-is-deleted/60904>\
**Category:** Development\
**Created:** [April 13, 2017, 8:32am UTC](https://meta.discourse.org/t/a-posts-topicembed-isnt-destroyed-when-the-post-is-deleted/60904 "2017-04-13T08:32:40Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)\
**Post date:** [April 13, 2017, 8:53am UTC](https://meta.discourse.org/t/a-posts-topicembed-isnt-destroyed-when-the-post-is-deleted/60904/2 "2017-04-13T08:53:05Z")

</div>

How are you fetching topic embeds? Maybe adding a scope like `where("topics.deleted_at IS NULL && posts.deleted_at IS NULL)` will help?

---

_[View the full topic](https://meta.discourse.org/t/a-posts-topicembed-isnt-destroyed-when-the-post-is-deleted/60904)._
