Skip to content

Commit

Permalink
value is always a link
Browse files Browse the repository at this point in the history
  • Loading branch information
mkon committed Oct 25, 2018
1 parent ca6c009 commit 572f11b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/active_model_serializers/adapter/json_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,8 @@ def relationships_for(serializer, requested_associations, include_slice)
# }.reject! {|_,v| v.nil? }
def links_for(serializer)
serializer._links.each_with_object({}) do |(name, value), hash|
if value.is_a?(ActiveModel::Serializer::Link)
next if value.excluded?(serializer)
value = value.block
end
result = Link.new(serializer, value).as_json
next if value.excluded?(serializer)
result = Link.new(serializer, value.block).as_json
hash[name] = result if result
end
end
Expand Down

0 comments on commit 572f11b

Please sign in to comment.