Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions lib/jsonapi/resource_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def object_hash(source, include_directives)
attributes = attribute_hash(source)
obj_hash['attributes'] = attributes unless attributes.empty?

relationships = relationships_hash(source, include_directives)
relationships = relationship_data(source, include_directives)
obj_hash['relationships'] = relationships unless relationships.nil? || relationships.empty?

return obj_hash
Expand All @@ -133,18 +133,6 @@ def attribute_hash(source)
end
end

def relationships_hash(source, include_directives)
rel_hash = {}

links = relationship_links(source)
rel_hash['links'] = links unless links.empty?

data = relationship_data(source, include_directives)
rel_hash['data'] = data unless data.empty?

# links_hash(source, include_directives)
end

def relationship_data(source, include_directives)
associations = source.class._associations
requested = requested_fields(source.class._type)
Expand Down