How to create and save a new model in Ember Data 1.13.7 and update the UI



I am using Ember 1.13.5 and Ember Data 1.13.7 and the default JSONAPIAdapter/Serializer and I have a problem saving a new model.

My route looks like this:

import Ember from 'ember';

export default Ember.Route.extend({

    model: function(params) {

	    return Ember.RSVP.hash({
		    auditLog:'log', {filter: {object: 'IsoApplication', object_id:}}),


This successfully returns a collection of “log” models in the “auditLog” key of the controller, e.g. this.get(‘model.auditLog’).

I create a new “log” model and save it successfully like this:

self = this;

var log ='log', {
    logLevelId: 2
    logTypeId: 2
    object: 'IsoApplication',
    objectId: 23
	message: 'A message',
	logData: '',
}); {

I use this line:


To update the model so that my new log entry is displayed in the UI but I get the following error:

TypeError: internalModel.getRecord is not a function

and the “log” parameter in the “save” callback is of type “InternalModel”. I was led to believe that InternalModels were only used by the Ember Data core code so presumably the “save” callback should return a DS.Model instance instead. Is something wrong here?

Also, am I doing the correct thing by using “pushObject” to update the “model.auditLog” collection of “log” models in order that the UI updates with the newly added model or should it be an automatic process?

Any help that anyone could offer would be appreciated.


I have also logged this issue on StackOverflow here:


Ok, I have found the solution to this problem here:


The specific post that helped me was:

var self = this;
var usersArray = [];
    store.find('user', params).then(function(users){
  usersArray.addObject('user' ));

The pushObject() function can no longer be used with versions of Ember Data 19+.