Skip to content

Commit

Permalink
Merge pull request #690 from trek/notify-that-a-default-adapter-is-used
Browse files Browse the repository at this point in the history
Notify that a default adapter type has been selected
  • Loading branch information
stefanpenner committed Apr 19, 2013
2 parents 5256ae4 + a6857c2 commit e6745f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion packages/ember-data/lib/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ DS.Store = Ember.Object.extend(DS._Mappable, {
@property {DS.Adapter|String}
*/
adapter: 'DS.RESTAdapter',
adapter: Ember.computed(function(){
Ember.debug("A custom DS.Adapter was not provided as the 'Adapter' property of your application's Store. The default (DS.RESTAdapter) will be used.");
return 'DS.RESTAdapter';
}).property(),


/**
@private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ test("Stores can create a new transaction", function() {
test("If a record is created from a transaction, it is not committed when store.commit() is called but is committed when transaction.commit() is called", function() {
var commitCalls = 0;

store.adapter = DS.Adapter.create({
set(store, 'adapter', DS.Adapter.create({
createRecords: function() {
commitCalls++;
}
});
}));

transaction = store.transaction();
transaction.createRecord(Person, {});
Expand All @@ -49,11 +49,11 @@ test("If a record is created from a transaction, it is not committed when store.
test("If a record is added to a transaction then updated, it is not committed when store.commit() is called but is committed when transaction.commit() is called", function() {
var commitCalls = 0;

store.adapter = DS.Adapter.create({
set(store, 'adapter', DS.Adapter.create({
updateRecords: function() {
commitCalls++;
}
});
}));

store.load(Person, { id: 1, name: "Yehuda Katz" });

Expand Down

0 comments on commit e6745f9

Please sign in to comment.