Created
April 10, 2011 03:28
-
-
Save jgn/912016 to your computer and use it in GitHub Desktop.
OrderedSet leveraging ActiveSupport::OrderedHash to get predictable behavior across 1.8.x, 1.9.x
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
# Force the underlying store for a Set to be an OrderedHash. | |
class OrderedSet < Set | |
def initialize(enum = nil, &block) | |
@hash ||= ActiveSupport::OrderedHash.new | |
super | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment