lib/public/collection.js
function(attrs, options) {

            // begin lazo specific overrides
            var modelName = null;
            if (this.modelName) {
                if (_.isFunction(this.modelName)) {
                    modelName = this.modelName(attrs, options);
                }
                else {
                    modelName = this.modelName;
                }
            }
            // end lazo specific overrides

            if (attrs instanceof Backbone.Model) {
                if (!attrs.collection) attrs.collection = this;
                if (!attrs.name && modelName) attrs.name = modelName; // lazo specific
                return attrs;
            }
            options || (options = {});
            options.collection = this;

            // begin lazo specific overrides
            if (modelName) {
                options.name = modelName;
            }

            options.ctx = this.ctx;
            // end lazo specific overrides

            var model = new this.model(attrs, options);
            if (!model._validate(attrs, options)) {
                this.trigger('invalid', this, attrs, options);
                return false;
            }
            return model;
        }
function(attrs, options) {

            // begin lazo specific overrides
            var modelName = null;
            if (this.modelName) {
                if (_.isFunction(this.modelName)) {
                    modelName = this.modelName(attrs, options);
                }
                else {
                    modelName = this.modelName;
                }
            }
            // end lazo specific overrides

            if (attrs instanceof Backbone.Model) {
                if (!attrs.collection) attrs.collection = this;
                if (!attrs.name && modelName) attrs.name = modelName; // lazo specific
                return attrs;
            }
            options || (options = {});
            options.collection = this;

            // begin lazo specific overrides
            if (modelName) {
                options.name = modelName;
            }

            options.ctx = this.ctx;
            // end lazo specific overrides

            var model = new this.model(attrs, options);
            if (!model._validate(attrs, options)) {
                this.trigger('invalid', this, attrs, options);
                return false;
            }
            return model;
        }
function ( attrs , options ) { // begin lazo specific overrides var modelName = null ; if ( this . modelName ) { if ( _ . isFunction ( this . modelName ) ) { modelName = this . modelName ( attrs , options ) ; } else { modelName = this . modelName ; } } // end lazo specific overrides if ( attrs instanceof Backbone . Model ) { if ( ! attrs . collection ) attrs . collection = this ; if ( ! attrs . name && modelName ) attrs . name = modelName ; // lazo specific return attrs ; } options || ( options = { } ) ; options . collection = this ; // begin lazo specific overrides if ( modelName ) { options . name = modelName ; } options . ctx = this . ctx ; // end lazo specific overrides var model = new this . model ( attrs , options ) ; if ( ! model . _validate ( attrs , options ) ) { this . trigger ( 'invalid' , this , attrs , options ) ; return false ; } return model ; }
taken directly from Backbone.Collection._prepareModel, except where noted by comments
taken directly from Backbone . Collection . _prepareModel except where noted by comments