-
Notifications
You must be signed in to change notification settings - Fork 540
Open
Description
Version 0.9.12
When using fields[events]=name + include=establishment the key relationships disappear from the response hash.
Basic association is events belongs_to establishment
Issue is coming from here:
# JSONAPI::ResourceSerializer#supplying_relationship_fields
def supplying_relationship_fields(resource_klass)
@_supplying_relationship_fields.fetch resource_klass do
relationships = Set.new(resource_klass._relationships.keys.map(&:to_sym))
cur = resource_klass
while cur != JSONAPI::Resource
if @fields.has_key?(cur._type)
# here...
# It always empty the Set
#relationships &= @fields[cur._type]
break
end
cur = cur.superclass
end
@_supplying_relationship_fields[resource_klass] = relationships
end
endCommenting relationships &= @fields[cur._type] solves this issue. @DavidMikeSimon could you describe your mind here? I know it was a loooong time ago but your help might help to correctly fix this issue.
Metadata
Metadata
Assignees
Labels
No labels