# Help with delete

**URL:** <https://www.ruby-forum.com/t/help-with-delete/125595>\
**Category:** Rails\
**Created:** [January 10, 2008, 1:14pm UTC](https://www.ruby-forum.com/t/help-with-delete/125595 "2008-01-10T13:14:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 10, 2008, 1:14pm UTC](https://www.ruby-forum.com/t/help-with-delete/125595/1 "2008-01-10T13:14:52Z")

</div>

repair\_tickets and rp\_parts are HABTM.

If I do:

> > repair\_ticket1.rp\_parts  
> > =\> [#\<RpPart id: 1, …"\>, #\<RpPart id: 1,…"\>, #\<RpPart …"\>]

I only want to delete one of those RpPart id:1, and not both of them. Is  
it possible? How can I do that?

---

<div class="post-metadata">

**Author:** ![captaffy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f04885/32.png) [@captaffy](https://www.ruby-forum.com/u/captaffy)\
**Post date:** [January 10, 2008, 1:32pm UTC](https://www.ruby-forum.com/t/help-with-delete/125595/2 "2008-01-10T13:32:10Z")

</div>

If you want to remove duplicates from your array you do

repair\_ticket1.rp\_parts.uniq!

On Jan 10, 2008 12:14 PM, John S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
