Fix comments and formatting in JSONAPI deserializable resource

This commit is contained in:
ari 2024-03-17 17:17:34 +03:00
parent 726d6828db
commit 2c4418d5ec
No known key found for this signature in database
GPG Key ID: 1A5559E2E32F1805

View File

@ -225,7 +225,7 @@ module JSONAPI
cross_reference = @included.select { |doc| doc[:object]&.instance_variable_get(:@id) == id && doc[:object].instance_variable_get(:@type) == type }&.first
# If the deserializer is created using a given class, we will need to call .to_h on it instead of plucking all its attributes
cross_reference[:has_deserializer] ? cross_reference[:object].to_h : cross_reference[:object].instance_variable_get(:@attributes).to_h
cross_reference[:has_deserializer] ? cross_reference[:object].to_h : cross_reference[:object].instance_variable_get(:@attributes).to_h.merge({ id: id, type: type })
end
# rubocop: enable Metrics/AbcSize
end