Skip to content

Commit cbce78d

Browse files
committed
Don't call link_builder when custom link is provided
1 parent 3b1d574 commit cbce78d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/jsonapi/resource_serializer.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,9 @@ def meta_hash(source)
230230
end
231231

232232
def links_hash(source)
233-
{
234-
self: link_builder.self_link(source)
235-
}.merge(custom_links_hash(source)).compact
233+
links = custom_links_hash(source)
234+
links[:self] = link_builder.self_link(source) unless links.key?(:self)
235+
links.compact
236236
end
237237

238238
def custom_links_hash(source)

0 commit comments

Comments
 (0)