Adapt deserialization methods to new schema
This commit is contained in:
parent
945c499de7
commit
c38066408f
|
|
@ -2,12 +2,6 @@
|
||||||
|
|
||||||
module DeserializeHelpers
|
module DeserializeHelpers
|
||||||
def deserialize_response(response)
|
def deserialize_response(response)
|
||||||
ActiveModelSerializers::Deserialization.jsonapi_parse(JSON.parse(response.body))
|
JSON.parse(response.body, symbolize_names: true)
|
||||||
end
|
|
||||||
|
|
||||||
def deserialize_list(response)
|
|
||||||
JSON.parse(response.body, symbolize_names: true)[:data].map do |raw_obj|
|
|
||||||
raw_obj[:attributes].merge raw_obj.except(:attributes)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue