Skip to content

Commit

Permalink
Load the JSONAPIAdapter out of require instead of assuming its on a D…
Browse files Browse the repository at this point in the history
…S global
  • Loading branch information
bmac committed Jan 24, 2016
1 parent 74d8ea5 commit 849f23a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ember-test-helpers/test-module-for-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ export default TestModule.extend({

var adapterFactory = container.lookupFactory('adapter:application');
if (!adapterFactory) {
adapterFactory = DS.JSONAPIAdapter || DS.FixtureAdapter;
if (requirejs.entries['ember-data/adapters/json-api']) {
adapterFactory = require('ember-data/adapters/json-api')['default'];
} else {
adapterFactory = DS.JSONAPIAdapter || DS.FixtureAdapter;
}

var thingToRegisterWith = this.registry || this.container;
thingToRegisterWith.register('adapter:application', adapterFactory);
Expand Down

0 comments on commit 849f23a

Please sign in to comment.