Skip to content

Commit a85c1d0

Browse files
knapolgebhardt
authored andcommitted
Don't call link_builder when custom link is provided
(cherry picked from commit cbce78d)
1 parent 78a8555 commit a85c1d0

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
@@ -171,9 +171,9 @@ def meta_hash(source)
171171
end
172172

173173
def links_hash(source)
174-
{
175-
self: link_builder.self_link(source)
176-
}.merge(custom_links_hash(source)).compact
174+
links = custom_links_hash(source)
175+
links[:self] = link_builder.self_link(source) unless links.key?(:self)
176+
links.compact
177177
end
178178

179179
def custom_links_hash(source)

0 commit comments

Comments
 (0)