This project is archived and is in readonly mode.
[PATCH] ActiveSupport::OrderedHash#each* methods without block are incorrect in 1.8
Reported by ghorner | February 3rd, 2011 @ 04:34 AM
In ruby 1.8.x, ordered hashes don't behave like normal hashes when calling each* methods without a block:
>> {:a => 1}.each
=> #<Enumerable::Enumerator:0x25637c>
>> h = ActiveSupport::OrderedHash.new.merge :a => 1
=> #<OrderedHash {:a=>1}>
>> h.each
LocalJumpError: no block given
./lib/active_support/ordered_hash.rb:150:in `each'
./lib/active_support/ordered_hash.rb:150:in `each'
In ruby 1.9, the above works fine for ordered hashes.
Comments and changes to this ticket
-
ghorner February 3rd, 2011 @ 04:40 AM
- Tag set to patch
-
cldwalker February 3rd, 2011 @ 04:42 AM
- Title changed from ActiveSupport::OrderedHash#each* methods without block are incorrect in 1.8 to [PATCH] ActiveSupport::OrderedHash#each* methods without block are incorrect in 1.8
-
Repository February 3rd, 2011 @ 09:28 PM
- State changed from new to resolved
(from [c0b4db0c28465866b656c894c16ce35f4d313a12]) fix OrderedHash#each* methods to return Enumerators when called without a block [#6366 state:resolved]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
https://github.com/rails/rails/commit/c0b4db0c28465866b656c894c16ce...
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
Tags
Referenced by
- 6366 [PATCH] ActiveSupport::OrderedHash#each* methods without block are incorrect in 1.8 (from [c0b4db0c28465866b656c894c16ce35f4d313a12]) fix Ord...