# \`has\_one\_attached\` doesn't remove blob

**URL:** <https://discuss.rubyonrails.org/t/has-one-attached-doesnt-remove-blob/81677>\
**Category:** rubyonrails-talk\
**Tags:** activestorage\
**Created:** [November 1, 2022, 10:14am UTC](https://discuss.rubyonrails.org/t/has-one-attached-doesnt-remove-blob/81677 "2022-11-01T10:14:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zolis](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/zolis/32/8943_2.png) [@zolis](https://discuss.rubyonrails.org/u/zolis)\
**Post date:** [November 1, 2022, 10:14am UTC](https://discuss.rubyonrails.org/t/has-one-attached-doesnt-remove-blob/81677/1 "2022-11-01T10:14:37Z")

</div>

Using Rails 7.0.4.

I have a model with `has_one_attached :file`, and when I destroy the model with `MyModel#destroy`, the corresponding `ActiveStorage::Blob` isn’t deleted.

For it to be deleted, I have added an `after_destroy` callback that simply does `file.purge_later`. Only then is the blob for that file deleted.

Is that by design?

My understanding was that `has_one_attached :file` would take care of doing `file.purge_later` automatically upon the model’s deletion without my having to manually call the method.

What am I missing?

---

<div class="post-metadata">

**Author:** ![zolis](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/zolis/32/8943_2.png) [@zolis](https://discuss.rubyonrails.org/u/zolis)\
**Post date:** [November 1, 2022, 11:57am UTC](https://discuss.rubyonrails.org/t/has-one-attached-doesnt-remove-blob/81677/2 "2022-11-01T11:57:54Z")

</div>

Ok, nevermind, I didn’t realize I had to start sidekiq to actually process the purge jobs…
