Help with delete

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?

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. [email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs