dist/globals/ember-data.prod.js in ember-data-source-2.12.0.beta.1 vs dist/globals/ember-data.prod.js in ember-data-source-2.12.0.beta.2

- old
+ new

@@ -4,11 +4,11 @@ /*! * @overview Ember Data * @copyright Copyright 2011-2016 Tilde Inc. and contributors. * Portions Copyright 2011 LivingSocial Inc. * @license Licensed under MIT license (see license.js) - * @version 2.12.0-beta.1 + * @version 2.12.0-beta.2 */ var loader, define, requireModule, require, requirejs; (function(global) { @@ -878,11 +878,11 @@ // ES5 §15.9.4.2 states that the string should attempt to be parsed as a Date Time String Format string // before falling back to any implementation-specific date parsing, so that’s what we do, even if native // implementations could be faster // 1 YYYY 2 MM 3 DD 4 HH 5 mm 6 ss 7 msec 8 Z 9 ± 10 tzHH 11 tzmm - if (struct = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?:(\d{2}))?)?)?$/.exec(date)) { + if (struct = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2}):?(?:(\d{2}))?)?)?$/.exec(date)) { // avoid NaN timestamps caused by “undefined” values being passed to Date.UTC for (var i = 0, k; k = numericKeys[i]; ++i) { struct[k] = +struct[k] || 0; } @@ -11099,12 +11099,19 @@ var normalizedModelName = (0, _emberDataPrivateSystemNormalizeModelName.default)(modelName); // container.registry = 2.1 // container._registry = 1.11 - 2.0 // container = < 1.11 var owner = (0, _emberDataPrivateUtils.getOwner)(this); + var mixin = undefined; - var mixin = owner._lookupFactory('mixin:' + normalizedModelName); + if (owner.factoryFor) { + var MaybeMixin = owner.factoryFor('mixin:' + normalizedModelName); + mixin = MaybeMixin && MaybeMixin.class; + } else { + mixin = owner._lookupFactory('mixin:' + normalizedModelName); + } + if (mixin) { //Cache the class as a model owner.register('model:' + normalizedModelName, _emberDataModel.default.extend(mixin)); } var factory = this.modelFactoryFor(normalizedModelName); @@ -11163,11 +11170,18 @@ */ modelFactoryFor: function (modelName) { var trueModelName = this._classKeyFor(modelName); var owner = (0, _emberDataPrivateUtils.getOwner)(this); - return owner._lookupFactory('model:' + trueModelName); + if (owner.factoryFor) { + var MaybeModel = owner.factoryFor('model:' + trueModelName); + var MaybeModelFactory = MaybeModel && MaybeModel.class; + + return MaybeModelFactory; + } else { + return owner._lookupFactory('model:' + trueModelName); + } }, /** Push some data for a given type into the store. This method expects normalized [JSON API](http://jsonapi.org/) document. This means you have to follow [JSON API specification](http://jsonapi.org/format/) with few minor adjustments: @@ -11358,11 +11372,17 @@ return internalModelOrModels; }, _hasModelFor: function (modelName) { - return !!(0, _emberDataPrivateUtils.getOwner)(this)._lookupFactory('model:' + modelName); + var owner = (0, _emberDataPrivateUtils.getOwner)(this); + + if (owner.factoryFor) { + return !!owner.factoryFor('model:' + modelName); + } else { + return !!owner._lookupFactory('model:' + modelName); + } }, _pushInternalModel: function (data) { var modelName = data.type; @@ -12357,11 +12377,11 @@ /* ember-container-inject-owner is a new feature in Ember 2.3 that finally provides a public API for looking items up. This function serves as a super simple polyfill to avoid triggering deprecations. - */ + */ function getOwner(context) { var owner; if (_ember.default.getOwner) { owner = _ember.default.getOwner(context); @@ -19354,10 +19374,10 @@ */ deserialize: null }); }); define("ember-data/version", ["exports"], function (exports) { - exports.default = "2.12.0-beta.1"; + exports.default = "2.12.0-beta.2"; }); define("ember-inflector", ["exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (exports, _ember, _emberInflectorLibSystem, _emberInflectorLibExtString) { _emberInflectorLibSystem.Inflector.defaultRules = _emberInflectorLibSystem.defaultRules; _ember.default.Inflector = _emberInflectorLibSystem.Inflector;