File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
activesupport/lib/active_support/json Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change 11require 'active_support/core_ext/object/to_json'
22require 'active_support/core_ext/module/delegation'
33require 'active_support/json/variable'
4- require 'active_support/ordered_hash'
54
65require 'bigdecimal'
76require 'active_support/core_ext/big_decimal/conversions' # for #to_s
@@ -239,8 +238,7 @@ def as_json(options = nil) #:nodoc:
239238
240239 # use encoder as a proxy to call as_json on all values in the subset, to protect from circular references
241240 encoder = options && options [ :encoder ] || ActiveSupport ::JSON ::Encoding ::Encoder . new ( options )
242- result = self . is_a? ( ActiveSupport ::OrderedHash ) ? ActiveSupport ::OrderedHash : Hash
243- result [ subset . map { |k , v | [ k . to_s , encoder . as_json ( v , options ) ] } ]
241+ Hash [ subset . map { |k , v | [ k . to_s , encoder . as_json ( v , options ) ] } ]
244242 end
245243
246244 def encode_json ( encoder )
You can’t perform that action at this time.
0 commit comments