Update code so Ember 2.3 can have more tests passing
This commit is contained in:
@@ -36,10 +36,24 @@ export default function(name, opts) {
|
||||
this.registry.register('store:main', store, { instantiate: false });
|
||||
|
||||
if (opts.setup) {
|
||||
if (Ember.VERSION[0] === "2") {
|
||||
// use closure actions instead
|
||||
this.on = (actionName, fn) => this.set(actionName, fn);
|
||||
}
|
||||
|
||||
opts.setup.call(this, store);
|
||||
}
|
||||
|
||||
andThen(() => this.render(opts.template));
|
||||
andThen(() => {
|
||||
// TODO: This shouldn't be necessary
|
||||
this.owner = {
|
||||
hasRegistration: (...args) => this.registry.has(...args),
|
||||
lookup: (...args) => this.container.lookup(...args),
|
||||
_lookupFactory: (...args) => this.container.lookupFactory(...args)
|
||||
};
|
||||
|
||||
return this.render(opts.template);
|
||||
});
|
||||
andThen(() => opts.test.call(this, assert));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,8 +6,9 @@ import { buildResolver } from 'discourse-common/resolver';
|
||||
|
||||
export default function() {
|
||||
const resolver = buildResolver('discourse').create();
|
||||
|
||||
return Store.create({
|
||||
container: {
|
||||
register: {
|
||||
lookup(type) {
|
||||
if (type === "adapter:rest") {
|
||||
this._restAdapter = this._restAdapter || RestAdapter.create({ container: this });
|
||||
|
||||
Reference in New Issue
Block a user