-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
respect other Hashie::Hash subclasses when assigning a value
When assigning a raw ruby Hash, the hash should be converted to the current subclass. But when assigning an existing subclass, we should keep the existing subclass's type. Example: h = {:foo => 'bar'} m = Hashie::Mash.new m.value = h m.value.class # Hashie::Mash class SubMash < Hashie::Mash end h = SubMash.new(:foo => 'bar') m = Hashie::Mash.new m.value = h m.value.class # Hashie::SubMash <- should not be converted to a Mash
- Loading branch information
Jerry Cheung
committed
Jun 4, 2012
1 parent
6d21c68
commit 3fa6126
Showing
2 changed files
with
9 additions
and
3 deletions.
There are no files selected for viewing
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
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