assets/js/vendor/backbone-relational.js
function (type, attributes) {
			if ( type._subModels && type.prototype.subModelTypeAttribute in attributes ) {
				var subModelTypeAttribute = attributes[type.prototype.subModelTypeAttribute];
				var subModelType = type._subModels[subModelTypeAttribute];
				if ( subModelType ) {
					return subModelType;
				} else {
					// Recurse into subModelTypes to find a match
					for ( subModelTypeAttribute in type._subModels ) {
						subModelType = this._findSubModelType(type._subModels[subModelTypeAttribute], attributes);
						if ( subModelType ) {
							return subModelType;
						}
					}
				}
			}
			return null;
		}
function (type, attributes) {
			if ( type._subModels && type.prototype.subModelTypeAttribute in attributes ) {
				var subModelTypeAttribute = attributes[type.prototype.subModelTypeAttribute];
				var subModelType = type._subModels[subModelTypeAttribute];
				if ( subModelType ) {
					return subModelType;
				} else {
					// Recurse into subModelTypes to find a match
					for ( subModelTypeAttribute in type._subModels ) {
						subModelType = this._findSubModelType(type._subModels[subModelTypeAttribute], attributes);
						if ( subModelType ) {
							return subModelType;
						}
					}
				}
			}
			return null;
		}
Determines what type of (sub)model should be built if applicable.
Looks up the proper subModelType in 'this._subModels', recursing into
types until a match is found.  Returns the applicable 'Backbone.Model'
or null if no match is found.
@param {Backbone.Model} type
@param {Object} attributes
@return {Backbone.Model}