Merge pull request #41712 from okuramasafumi/remove-ordered-hash

Remove requires and references to OrderedHash
This commit is contained in:
Ryuta Kamizono 2021-03-22 22:01:26 +09:00 committed by GitHub
commit 1ef30c19b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 6 deletions

View File

@ -19,8 +19,7 @@ require "active_support/core_ext/date/conversions"
# The JSON gem adds a few modules to Ruby core classes containing :to_json definition, overwriting
# their default behavior. That said, we need to define the basic to_json method in all of them,
# otherwise they will always use to_json gem implementation, which is backwards incompatible in
# several cases (for instance, the JSON implementation for Hash does not work) with inheritance
# and consequently classes as ActiveSupport::OrderedHash cannot be serialized to json.
# several cases (for instance, the JSON implementation for Hash does not work) with inheritance.
#
# On the other hand, we should avoid conflict with ::JSON.{generate,dump}(obj). Unfortunately, the
# JSON gem's encoder relies on its own to_json implementation to encode objects. Since it always

View File

@ -4,7 +4,6 @@ require_relative "../abstract_unit"
require "active_support/core_ext/hash"
require "bigdecimal"
require "active_support/core_ext/string/access"
require "active_support/ordered_hash"
require "active_support/core_ext/object/conversions"
require "active_support/core_ext/date/conversions"
require "active_support/core_ext/object/deep_dup"

View File

@ -1,7 +1,6 @@
# frozen_string_literal: true
require_relative "../../abstract_unit"
require "active_support/ordered_hash"
require "active_support/core_ext/object/to_query"
require "active_support/core_ext/string/output_safety"

View File

@ -4,7 +4,6 @@ require_relative "abstract_unit"
require "active_support/core_ext/hash"
require "bigdecimal"
require "active_support/core_ext/string/access"
require "active_support/ordered_hash"
require "active_support/core_ext/object/conversions"
require "active_support/core_ext/object/deep_dup"
require "active_support/inflections"

View File

@ -446,7 +446,7 @@ NOTE: Defined in `active_support/core_ext/object/with_options.rb`.
### JSON support
Active Support provides a better implementation of `to_json` than the `json` gem ordinarily provides for Ruby objects. This is because some classes, like `Hash`, `OrderedHash` and `Process::Status` need special handling in order to provide a proper JSON representation.
Active Support provides a better implementation of `to_json` than the `json` gem ordinarily provides for Ruby objects. This is because some classes, like `Hash` and `Process::Status` need special handling in order to provide a proper JSON representation.
NOTE: Defined in `active_support/core_ext/object/json.rb`.