mirror of
https://github.com/ditkrg/jsonapi-deserializable.git
synced 2026-01-22 22:06:47 +00:00
Fix comments and formatting in JSONAPI deserializable resource
This commit is contained in:
parent
726d6828db
commit
2c4418d5ec
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user