1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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 # 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, # 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 # 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 # 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.
# #
# On the other hand, we should avoid conflict with ::JSON.{generate,dump}(obj). Unfortunately, the # 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 # 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 "active_support/core_ext/hash"
require "bigdecimal" require "bigdecimal"
require "active_support/core_ext/string/access" 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/conversions"
require "active_support/core_ext/date/conversions" require "active_support/core_ext/date/conversions"
require "active_support/core_ext/object/deep_dup" require "active_support/core_ext/object/deep_dup"

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require_relative "../../abstract_unit" require_relative "../../abstract_unit"
require "active_support/ordered_hash"
require "active_support/core_ext/object/to_query" require "active_support/core_ext/object/to_query"
require "active_support/core_ext/string/output_safety" 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 "active_support/core_ext/hash"
require "bigdecimal" require "bigdecimal"
require "active_support/core_ext/string/access" 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/conversions"
require "active_support/core_ext/object/deep_dup" require "active_support/core_ext/object/deep_dup"
require "active_support/inflections" require "active_support/inflections"

View file

@ -446,7 +446,7 @@ NOTE: Defined in `active_support/core_ext/object/with_options.rb`.
### JSON support ### 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`. NOTE: Defined in `active_support/core_ext/object/json.rb`.