Skip to content

Commit

Permalink
Default to using the JSONAPIAdapter
Browse files Browse the repository at this point in the history
  • Loading branch information
bmac committed Jul 3, 2015
1 parent acee775 commit 97a9d7e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/ember-data/lib/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Store = Service.extend({
@default DS.RESTAdapter
@type {(DS.Adapter|String)}
*/
adapter: '-rest',
adapter: '-json-api',

/**
Returns a JSON representation of the record using a custom
Expand Down Expand Up @@ -2212,7 +2212,7 @@ Store = Service.extend({

_adapterFallbacks: Ember.computed('adapter', function() {
var adapter = this.get('adapter');
return ['application', adapter, '-rest'];
return ['application', adapter, '-json-api'];
}),

lookupSerializer: function(name, fallbacks) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ Ember.merge(ContainerInstanceCache.prototype, {
},

instanceFor: function(key) {
if (key === 'adapter:-rest') {
Ember.deprecate('You are currently using the default DS.RESTAdapter adapter. For Ember 2.0 the default adapter will be DS.JSONAPIAdapter. If you would like to continue using DS.RESTAdapter please create an application adapter that extends DS.RESTAdapter.');
}

let cache = this._cache;
if (!cache[key]) {
let instance = this._container.lookup(key);
Expand Down
11 changes: 11 additions & 0 deletions packages/ember-data/tests/integration/application-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ test("registering App.Store is deprecated but functional", function() {
});
});

test("The JSONAPIAdapter is the default adapter when no custom adapter is provided", function() {
run(function() {
var store = getStore();

var adapter = store.adapterFor('application');

ok(adapter instanceof DS.JSONAPIAdapter, 'default adapter should be the JSONAPIAdapter');
});
});


module("integration/application - Injecting the Default Store", {
setup: function() {
run(function() {
Expand Down

0 comments on commit 97a9d7e

Please sign in to comment.