Created
March 23, 2011 18:21
-
-
Save lyleunderwood/883631 to your computer and use it in GitHub Desktop.
ActiveSupport::HashWithIndifferentAccess#merge bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Regular Hash behavior: | |
irb(main):023:0> a = {"one"=>"aye", "two"=>"bee"} | |
=> {"one"=>"aye", "two"=>"bee"} | |
irb(main):024:0> a.merge(a) {|k,v| 1} | |
=> {"one"=>1, "two"=>1} | |
Crazy HashWithIndifferentAccess behavior: | |
irb(main):025:0> b = ActiveSupport::HashWithIndifferentAccess.new("one"=>"aye", "two"=>"bee") | |
=> {"one"=>"aye", "two"=>"bee"} | |
irb(main):026:0> b.merge(b) {|k,v| 1} | |
=> {"one"=>"aye", "two"=>"bee"} | |
^^^ | |
Bug? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment