Skip to content

Commit

Permalink
Merge pull request #3840 from bmac/backport-3665
Browse files Browse the repository at this point in the history
Backport Fix usage of registry for 2.1.0+ from pr #3665
  • Loading branch information
bmac committed Oct 16, 2015
2 parents 0f3c4d1 + f92d07f commit b3060e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/ember-data/lib/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1742,8 +1742,11 @@ Store = Service.extend({

_modelForMixin: function(modelName) {
var normalizedModelName = normalizeModelName(modelName);
var registry = this.container._registry ? this.container._registry : this.container;
var mixin = registry.resolve('mixin:' + normalizedModelName);
// container.registry = 2.1
// container._registry = 1.11 - 2.0
// container = < 1.11
var registry = this.container.registry || this.container._registry || this.container;
var mixin = this.container.lookupFactory('mixin:' + normalizedModelName);
if (mixin) {
//Cache the class as a model
registry.register('model:' + normalizedModelName, DS.Model.extend(mixin));
Expand Down
4 changes: 2 additions & 2 deletions packages/ember-data/tests/unit/many-array-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ test("manyArray trigger arrayContentChange functions with the correct values", f
willChangeStartIdx = startIdx;
willChangeRemoveAmt = removeAmt;
willChangeAddAmt = addAmt;
return this._super.apply(arguments);
return this._super.apply(this, arguments);
},
arrayContentDidChange: function(startIdx, removeAmt, addAmt) {
equal(startIdx, willChangeStartIdx, 'WillChange and DidChange startIdx should match');
equal(removeAmt, willChangeRemoveAmt, 'WillChange and DidChange removeAmt should match');
equal(addAmt, willChangeAddAmt, 'WillChange and DidChange addAmt should match');
return this._super.apply(arguments);
return this._super.apply(this, arguments);
}
});
run(function() {
Expand Down

0 comments on commit b3060e6

Please sign in to comment.