# \[ActiveSupport\] Hash#deep\_delete/0+ core extension

**URL:** <https://discuss.rubyonrails.org/t/activesupport-hash-deep-delete-0-core-extension/73056>\
**Category:** rubyonrails-core\
**Tags:** feature\
**Created:** [April 9, 2018, 1:45pm UTC](https://discuss.rubyonrails.org/t/activesupport-hash-deep-delete-0-core-extension/73056 "2018-04-09T13:45:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![r.kakorin](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@r.kakorin](https://discuss.rubyonrails.org/u/r.kakorin)\
**Post date:** [April 9, 2018, 1:45pm UTC](https://discuss.rubyonrails.org/t/activesupport-hash-deep-delete-0-core-extension/73056/1 "2018-04-09T13:45:01Z")

</div>

Its a quite necessary feature which is needed for working with too large hashes, when you need to clear some data from specified fields which are located on different nesting levels, e.g. personal data. Its provides removing key-value pair in any level nesting of hash pair. Example:

{ k: 1, v: { l: { t: 2 } } }.deep\_delete(:t)

# =\> {:k=\>1, :v=\>{:l=\>{}}

``

I have code for this feature and want to commit this.

---

<div class="post-metadata">

**Author:** ![r.kakorin](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@r.kakorin](https://discuss.rubyonrails.org/u/r.kakorin)\
**Post date:** [April 9, 2018, 2:38pm UTC](https://discuss.rubyonrails.org/t/activesupport-hash-deep-delete-0-core-extension/73056/2 "2018-04-09T14:38:20Z")

</div>

Arity is a 1+
