@@ -83,7 +83,7 @@ def parse!(document, options = {})
83
83
# on invalid payloads.
84
84
def parse ( document , options = { } )
85
85
# TODO: change to jsonapi-ralis to have default conversion to flat hashes
86
- result = JSONAPI ::Rails :: DeserializableResource . new ( document , options : options ) . to_hash
86
+ result = JSONAPI ::Deserializable :: ActiveRecord . new ( document , options : options ) . to_hash
87
87
result = apply_options ( result , options )
88
88
result
89
89
rescue JSONAPI ::Parser ::InvalidDocument => e
@@ -94,7 +94,6 @@ def parse(document, options = {})
94
94
def apply_options ( hash , options )
95
95
hash = transform_keys ( hash , options ) if options [ :key_transform ]
96
96
hash = hash . deep_symbolize_keys
97
- hash = filter_fields ( hash , options )
98
97
hash = rename_fields ( hash , options )
99
98
hash
100
99
end
@@ -106,14 +105,6 @@ def transform_keys(hash, options)
106
105
CaseTransform . send ( transform , hash )
107
106
end
108
107
109
- # executes only
110
- # then except
111
- def filter_fields ( hash , options )
112
- hash = hash . select { |k , v | options [ :only ] . include? ( k ) } if options [ :only ]
113
- hash = hash . select { |k , v | !options [ :except ] . include? ( k ) } if options [ :except ]
114
- hash
115
- end
116
-
117
108
def rename_fields ( hash , options )
118
109
return hash unless options [ :keys ]
119
110
0 commit comments