My specific error message is this:
Error while processing route: debtor.index Ember.Adapter must implement find
Here is the model that I have defined:
var attr = Ember.attr, hasMany = Ember.hasMany;
export default Ember.Model.extend({
debtor_id: attr(),
debtor_full_name: attr(),
debtor_next_contact_date: attr(),
debtor_street1: attr(),
debtor_street2: attr(),
debtor_city: attr(),
debtor_state: attr(),
debtor_postal_code: attr(),
debtor_country_name: attr(),
debtor_tax_id: attr(),
debtor_date_of_birth: attr(),
debtor_email: attr(),
debtor_balance: attr()
});
this.adapter = Ember.RESTAdapter.create();
this.url = 'api/rest/debtor'
this.rootKey = 'data';
this.collectionKey = 'debtors';
this.primaryKey = 'debtor_id';
Here is the Route for debtor:
import Debtor from '../models/debtor';
export default Ember.Route.extend({
model: function(params) {
return Debtor.find(params.debtor_id);
}
});
My question: is using this
the correct way to define those properties inside of the model (considering Ember-CLI syntax)? Is there something else that I am missing that could be causing this error?