js/libs/ember-data.js
function(key) {
    var factory;


    if (typeof key === 'string') {
      var normalizedKey = this.container.normalize('model:' + key);

      factory = this.container.lookupFactory(normalizedKey);
      if (!factory) { throw new Ember.Error("No model was found for '" + key + "'"); }
      factory.typeKey = normalizedKey.split(':', 2)[1];
    } else {
      // A factory already supplied.
      factory = key;
    }

    factory.store = this;
    return factory;
  }
function(key) {
    var factory;


    if (typeof key === 'string') {
      var normalizedKey = this.container.normalize('model:' + key);

      factory = this.container.lookupFactory(normalizedKey);
      if (!factory) { throw new Ember.Error("No model was found for '" + key + "'"); }
      factory.typeKey = normalizedKey.split(':', 2)[1];
    } else {
      // A factory already supplied.
      factory = key;
    }

    factory.store = this;
    return factory;
  }
function ( key ) { var factory ; if ( typeof key === 'string' ) { var normalizedKey = this . container . normalize ( 'model:' + key ) ; factory = this . container . lookupFactory ( normalizedKey ) ; if ( ! factory ) { throw new Ember . Error ( "No model was found for '" + key + "'" ) ; } factory . typeKey = normalizedKey . split ( ':' , 2 ) [ 1 ] ; } else { // A factory already supplied. factory = key ; } factory . store = this ; return factory ; }
Returns a model class for a particular key. Used by
methods that take a type key (like `find`, `createRecord`,
etc.)

@method modelFor
@param {String or subclass of DS.Model} key
@returns {subclass of DS.Model}
Returns a model class for a particular key . Used by methods that take a type key ( like find createRecord etc . )