mardi 4 août 2015

What array name does Ember Data expect for sub directory models?

I recently started learning Ember and using Ember-CLI so I'm not quite well educated about Ember Data and what array names it expects for relationships that are in sub directories in my app.

// models/server.js
import DS from 'ember-data';

export default DS.Model.extend({
  serverHistory: DS.hasMany("history/server", { async: true })
});

// models/history/server.js
import DS from 'ember-data';

export default DS.Model.extend({
  server: DS.belongsTo("server", { async: true })
});

I've tried returning these names from my API

server_historys_ids
server_histories_ids
history_server_ids
history_servers_ids

But I don't see an XML request for Server history in my application. The servers itself are fetched fine.




Aucun commentaire:

Enregistrer un commentaire