Skip to content

Commit

Permalink
Don't call link_builder when custom link is provided
Browse files Browse the repository at this point in the history
(cherry picked from commit cbce78d)
  • Loading branch information
knapo authored and lgebhardt committed Oct 5, 2016
1 parent 78a8555 commit a85c1d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/jsonapi/resource_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ def meta_hash(source)
end

def links_hash(source)
{
self: link_builder.self_link(source)
}.merge(custom_links_hash(source)).compact
links = custom_links_hash(source)
links[:self] = link_builder.self_link(source) unless links.key?(:self)
links.compact
end

def custom_links_hash(source)
Expand Down

0 comments on commit a85c1d0

Please sign in to comment.