This project is archived and is in readonly mode.
Add first and last to OrderedHash
-
James
Very handy indeed. Good to get this functionality back.
-
Brian Hogan
+1 just because of uniformity. Like .each or .collect.
-
Gareth Adams
This is a useful patch, +1
I was planning to open a bug report about OrderedHash#to_a not returning ordered results, maybe this is a better place for it?
-
John
I can add this to the patch if you like?
-
John
and now an ordered to_a method is included as well
-
John
- Tag set to verified
-
John
hey just pinging this ticket, it's been tagged verified for near a month
-
David Trasbo
- Assigned user set to Ryan Bigg
Regular hashes are ordered in Ruby 1.9, so I think this ticket should be marked as "won't fix" - in my opinion it serves no purpose to keep maintaining a piece of functionality that is available in newer versions of Ruby by default.
If people want OrderedHash to behave differently they can patch it on a per-app basis - or just upgrade.
-
Ryan Bigg
- State changed from new to verified
- Assigned user cleared.
If 3 people want a ticket it should be made into Rails unless Core vetos it. NOT marking as invalid, but rather verified so it should get some eyes.
-
Rizwan Reza
- Tag changed from verified to bugmash-review
The patch didn't apply cleanly and also implemented to_a.
The patch attach applies cleanly, passes all tests and only implements first and last, as there is an implementation of to_a there now.
-
Rizwan Reza
- Tag cleared.
- State changed from verified to wontfix
José replied:
OrderedHash behaves like a Hash now to be more close to Ruby 1.9 behavior. Since 1.9 we don't have #first and #last, OrderedHash shouldn't as well.
