src/collection/collection.js
function(oldModel, newModel){
        var index;

        if (oldModel && newModel && this.hasModel(oldModel) && !this.hasModel(newModel)) {
            index = this.indexOf(oldModel);

            if (index > -1) {
                this.act(function(){
                    this.add(newModel, index);

                    this.remove(oldModel);
                });

                !this.isActive() && this.signalChange() && this.resetChange();
            }
        }

        return this;
    }
function(oldModel, newModel){
        var index;

        if (oldModel && newModel && this.hasModel(oldModel) && !this.hasModel(newModel)) {
            index = this.indexOf(oldModel);

            if (index > -1) {
                this.act(function(){
                    this.add(newModel, index);

                    this.remove(oldModel);
                });

                !this.isActive() && this.signalChange() && this.resetChange();
            }
        }

        return this;
    }
function ( oldModel , newModel ) { var index ; if ( oldModel && newModel && this . hasModel ( oldModel ) && ! this . hasModel ( newModel ) ) { index = this . indexOf ( oldModel ) ; if ( index > - 1 ) { this . act ( function ( ) { this . add ( newModel , index ) ; this . remove ( oldModel ) ; } ) ; ! this . isActive ( ) && this . signalChange ( ) && this . resetChange ( ) ; } } return this ; }
Replace an existing model with a new one
@param  {Class} oldModel A Model instance that will be replaced with the new
@param  {Object || Class} newModel An object or Model instance that will replace the old
@return {Class} Collection Instance
Replace an existing model with a new one