In order to fetch label.releases_url, which is a relationship, but does not exists in the form of a hasMany, we try to create a new model labelReleases.
This new ressources endpoint is releases_url = api.discogs.com/labels/:id/releases
Therefore it allows us to get:
[x] serializelabel.release_url = discogs_api_url_string into label.labelReleases = label.id
[x] customize labelReleasesadapter to have it find the ressource at the right endpoint, under the labels resources
[ ] display then list of a label's release on its template page
Notes:
Maybe using a model is not the right solution for assigning the releases data to a label. I thought it was nice to use ember-data's adapter/serializer for making it work
The choice of model name labelReleases might be discussed. The idea here, is to stay close to the resource endpoint name and the hasMany only relation of this model.
In order to fetch
label.releases_url
, which is a relationship, but does not exists in the form of ahasMany
, we try to create a new modellabelReleases
.This new ressources endpoint is
releases_url
=api.discogs.com/labels/:id/releases
Therefore it allows us to get:
label.release_url = discogs_api_url_string
intolabel.labelReleases = label.id
labelReleases
adapter to have it find the ressource at the right endpoint, under thelabels
resourceslabelReleases
results,labelReleases.releases = hasMany('releases')
Notes:
labelReleases
might be discussed. The idea here, is to stay close to the resource endpoint name and the hasMany only relation of this model.