Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions addon/services/multi-store.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Ember from 'ember';
import DS from 'ember-data';
import getOwner from 'ember-getowner-polyfill';

export default Ember.Service.extend({
/**
Expand Down Expand Up @@ -40,7 +39,7 @@ export default Ember.Service.extend({
const storeNames = Ember.get(this, 'storeNames');

if (storeNames.indexOf(name) === -1) {
getOwner(this).register(`store:${name}`,
Ember.getOwner(this).register(`store:${name}`,
DS.Store.extend({
name: name
})
Expand All @@ -62,7 +61,7 @@ export default Ember.Service.extend({
const storeNames = Ember.get(this, 'storeNames');

if (storeNames.indexOf(name) !== -1) {
getOwner(this).unregister(`store:${name}`);
Ember.getOwner(this).unregister(`store:${name}`);
storeNames.removeObject(name);
return true;
}
Expand All @@ -77,7 +76,7 @@ export default Ember.Service.extend({
* @returns {boolean}
*/
getStore(name) {
return getOwner(this).lookup(`store:${name}`);
return Ember.getOwner(this).lookup(`store:${name}`);
},

/**
Expand All @@ -91,9 +90,9 @@ export default Ember.Service.extend({
switchInspectorStore(name) {
const store = name ?
this.getStore(name) :
getOwner(this).lookup('service:store');
Ember.getOwner(this).lookup('service:store');

let dataAdapter = getOwner(this).lookup('data-adapter:main');
let dataAdapter = Ember.getOwner(this).lookup('data-adapter:main');
dataAdapter.set('store', store);
}
});