This project is archived and is in readonly mode.
Added Hash#only for picking out specific attributes
Reported by Brandon Keepers | April 22nd, 2008 @ 02:35 PM
I've added Hash#only (opposite of Hash#except) for picking specific attributes out of a hash:
{:a => 1, :b => 2, :c => 3}.only(:a, :c)
Comments and changes to this ticket
-
Cheah Chu Yeow April 22nd, 2008 @ 05:46 PM
Take a look at Hash#slice in ActiveSupport (slice.rb) :) I think someone opened a similar ticket with patch in Trac before. Personally, I prefer #only but well.
-
Brandon Keepers April 22nd, 2008 @ 07:07 PM
Doh, didn't even look for it under that name. Ok, ignore this ticket.
-
Rick April 22nd, 2008 @ 08:54 PM
- State changed from new to invalid
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
Referenced by
- 989 where is send! ? Patch here: http://rails.lighthouseapp.com/p...