diff options
author | Chris Hapgood <cch1@hapgoods.com> | 2009-11-04 10:13:59 -0500 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2009-11-05 21:17:13 +1300 |
commit | 6c59e5a558922b8f4084533071c3d93e151858ac (patch) | |
tree | 21827e48685039c4e34fd13a2bdef967983ba416 /activesupport/lib/active_support/ordered_hash.rb | |
parent | a8ed10546d844fc15d87f5c8f168a18d0cdab5f0 (diff) | |
download | rails-6c59e5a558922b8f4084533071c3d93e151858ac.tar.gz rails-6c59e5a558922b8f4084533071c3d93e151858ac.tar.bz2 rails-6c59e5a558922b8f4084533071c3d93e151858ac.zip |
Fix OrderedHash#replace
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activesupport/lib/active_support/ordered_hash.rb')
-rw-r--r-- | activesupport/lib/active_support/ordered_hash.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/ordered_hash.rb b/activesupport/lib/active_support/ordered_hash.rb index 4324e40cbb..b492648610 100644 --- a/activesupport/lib/active_support/ordered_hash.rb +++ b/activesupport/lib/active_support/ordered_hash.rb @@ -120,6 +120,13 @@ module ActiveSupport dup.merge!(other_hash) end + # When replacing with another hash, the initial order of our keys must come from the other hash -ordered or not. + def replace(other) + super + @keys = other.keys + self + end + def inspect "#<OrderedHash #{super}>" end |