This project is archived and is in readonly mode.

#113 ✓resolved
Sean Ouimet

Delete() for OrderedHash to work like a Hash (not Array)

Reported by Sean Ouimet | May 5th, 2008 @ 11:31 AM

When using delete() on an OrderedHash a user would expect the command to work more like a Hash versus an Array. The deleted key should return the 'hash' value.

posts = posts.group_by(:&user_id)

#expected

users_posts = posts.delete(@current_user.id)

#current method to get Hash-like value returned

users_posts = posts.delete([@current_user.id, posts[@current_user.id]]).last

This patch adds a custom delete method to OrderedHash.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages