Skip to content

Commit d7f5c34

Browse files
committed
fixes a syntax error
1 parent 3ebf349 commit d7f5c34

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/fast_jsonapi/serialization_core.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def fetch_id(record, relationship, params)
173173
end
174174

175175
if relationship[:relationship_type] == :has_one
176-
record.public_send(relationship[:object_method_name])&.id
176+
record.public_send(relationship[:object_method_name]).try(:id)
177177
else
178178
record.public_send(relationship[:id_method_name])
179179
end

0 commit comments

Comments
 (0)