diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-09 07:24:22 -0800 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-02-09 07:24:22 -0800 |
commit | b171db87e2e651602d8f2cf7fd39e4f52319cf48 (patch) | |
tree | 9a78b2842105613525482960a4bfcfe6d3093113 | |
parent | d36a88435ee0e370be763de85b5e4376591849ac (diff) | |
parent | 53f442be283f68a89c3a0c2dcb460490fb94fdf9 (diff) | |
download | rails-b171db87e2e651602d8f2cf7fd39e4f52319cf48.tar.gz rails-b171db87e2e651602d8f2cf7fd39e4f52319cf48.tar.bz2 rails-b171db87e2e651602d8f2cf7fd39e4f52319cf48.zip |
Merge pull request #4963 from ram123naresh/update_rails_2_use1_9
Replaced OrderedHash usage with Ruby 1.9 Hash
-rw-r--r-- | activesupport/lib/active_support/json/encoding.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/json/encoding.rb b/activesupport/lib/active_support/json/encoding.rb index fcd83f8dea..b2adfea273 100644 --- a/activesupport/lib/active_support/json/encoding.rb +++ b/activesupport/lib/active_support/json/encoding.rb @@ -1,7 +1,6 @@ require 'active_support/core_ext/object/to_json' require 'active_support/core_ext/module/delegation' require 'active_support/json/variable' -require 'active_support/ordered_hash' require 'bigdecimal' require 'active_support/core_ext/big_decimal/conversions' # for #to_s @@ -239,8 +238,7 @@ class Hash # use encoder as a proxy to call as_json on all values in the subset, to protect from circular references encoder = options && options[:encoder] || ActiveSupport::JSON::Encoding::Encoder.new(options) - result = self.is_a?(ActiveSupport::OrderedHash) ? ActiveSupport::OrderedHash : Hash - result[subset.map { |k, v| [k.to_s, encoder.as_json(v, options)] }] + Hash[subset.map { |k, v| [k.to_s, encoder.as_json(v, options)] }] end def encode_json(encoder) |