File tree Expand file tree Collapse file tree 4 files changed +13
-14
lines changed Expand file tree Collapse file tree 4 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 9
9
require 'set'
10
10
require 'active_support/version'
11
11
require 'active_support/core_ext/hash/indifferent_access'
12
- require 'active_support/ordered_hash'
13
12
require 'active_support/core_ext/object/blank'
14
13
require 'active_support/core_ext/array/extract_options'
15
14
require 'active_support/core_ext/hash/deep_merge'
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ def unset_description_field(field)
98
98
# Merge multiple layers of settings into one hash.
99
99
def stacked_hash_to_hash ( settings )
100
100
return nil if settings . nil? || settings . blank?
101
- settings . each_with_object ( ActiveSupport :: OrderedHash . new ) { |value , result | result . deep_merge! ( value ) }
101
+ settings . each_with_object ( { } ) { |value , result | result . deep_merge! ( value ) }
102
102
end
103
103
104
104
# Returns an object which configures itself via an instance-context DSL.
Original file line number Diff line number Diff line change 1
1
module Grape
2
2
module ContentTypes
3
3
# Content types are listed in order of preference.
4
- CONTENT_TYPES = ActiveSupport :: OrderedHash [
5
- : xml, 'application/xml' ,
6
- : serializable_hash, 'application/json' ,
7
- : json, 'application/json' ,
8
- : binary, 'application/octet-stream' ,
9
- : txt, 'text/plain'
10
- ]
4
+ CONTENT_TYPES = {
5
+ xml : 'application/xml' ,
6
+ serializable_hash : 'application/json' ,
7
+ json : 'application/json' ,
8
+ binary : 'application/octet-stream' ,
9
+ txt : 'text/plain'
10
+ }
11
11
12
12
def self . content_types_for_settings ( settings )
13
13
return nil if settings . nil? || settings . blank?
14
14
15
- settings . each_with_object ( ActiveSupport :: OrderedHash . new ) { |value , result | result . merge! ( value ) }
15
+ settings . each_with_object ( { } ) { |value , result | result . merge! ( value ) }
16
16
end
17
17
18
18
def self . content_types_for ( from_settings )
Original file line number Diff line number Diff line change @@ -2812,10 +2812,10 @@ def serializable_hash
2812
2812
end
2813
2813
it 'hash' do
2814
2814
subject . get '/example' do
2815
- ActiveSupport :: OrderedHash [
2816
- : example1, 'example1' ,
2817
- : example2, 'example2'
2818
- ]
2815
+ {
2816
+ example1 : 'example1' ,
2817
+ example2 : 'example2'
2818
+ }
2819
2819
end
2820
2820
get '/example'
2821
2821
expect ( last_response . status ) . to eq ( 200 )
You can’t perform that action at this time.
0 commit comments