lib/modelItem.js
function create(item, model, data) {
    var serverProps = serverProperties(item, model, data).properties;
    return utils.socketPut(model.io, model.url + '/create/', serverProps).then(function(response) {
        _.merge(serverProps, response);
        return update(item, model, serverProps);
    }).then(function() {
        // Refresh all items that were referenced - some of their properties might change
        return Promise.all(_.map(serverProps.refresh, function(item) {
            return item.refresh();
        }));
    });
}
function create(item, model, data) {
    var serverProps = serverProperties(item, model, data).properties;
    return utils.socketPut(model.io, model.url + '/create/', serverProps).then(function(response) {
        _.merge(serverProps, response);
        return update(item, model, serverProps);
    }).then(function() {
        // Refresh all items that were referenced - some of their properties might change
        return Promise.all(_.map(serverProps.refresh, function(item) {
            return item.refresh();
        }));
    });
}
function create ( item , model , data ) { var serverProps = serverProperties ( item , model , data ) . properties ; return utils . socketPut ( model . io , model . url + '/create/' , serverProps ) . then ( function ( response ) { _ . merge ( serverProps , response ) ; return update ( item , model , serverProps ) ; } ) . then ( function ( ) { // Refresh all items that were referenced - some of their properties might change return Promise . all ( _ . map ( serverProps . refresh , function ( item ) { return item . refresh ( ) ; } ) ) ; } ) ; }
Creates the item on the server

@param {object} item
@param {Model} model
@param {object?} data
@returns {Promise}
Creates the item on the server