Skip to content

Commit

Permalink
remove deprecation warnings for 1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanley Stuart committed Aug 25, 2015
1 parent 6c6aa0f commit b943553
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions addon/adapters/pouch.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default DS.RESTAdapter.extend({
// skip changes for non-relational_pouch docs. E.g., design docs.
if (!obj.type || !obj.id || obj.type === '') { return; }

var store = this.container.lookup('store:main');
var store = this.store;

try {
store.modelFor(obj.type);
Expand All @@ -53,12 +53,12 @@ export default DS.RESTAdapter.extend({
return;
}

var recordInStore = store.getById(obj.type, obj.id);
var recordInStore = store.peekRecord(obj.type, obj.id);
if (!recordInStore) {
// The record hasn't been loaded into the store; no need to reload its data.
return;
}
if (!recordInStore.get('isLoaded') || recordInStore.get('isDirty')) {
if (!recordInStore.get('isLoaded') || recordInStore.get('hasDirtyAttributes')) {
// The record either hasn't loaded yet or has unpersisted local changes.
// In either case, we don't want to refresh it in the store
// (and for some substates, attempting to do so will result in an error).
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"ember": "^1.10.0",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-data": "~1.0.0-beta.15",
"ember-data": "~1.13.0",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4",
"ember-qunit": "0.3.3",
"ember-qunit-notifications": "0.0.7",
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/adapters/pouch-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function adapter() {
}

function store() {
return App.__container__.lookup('store:main');
return App.__container__.lookup('service:store');
}

test('can find all', function (assert) {
Expand All @@ -64,7 +64,7 @@ test('can find all', function (assert) {
{ _id: 'burritoShake_2_X', data: { consistency: 'smooth' } }
]);
}).then(() => {
return store().find('taco-soup');
return store().findAll('taco-soup');
}).then((found) => {
assert.equal(found.get('length'), 2, 'should have found the two taco soup items only');
assert.deepEqual(found.mapBy('id'), ['A', 'B'],
Expand Down Expand Up @@ -146,7 +146,7 @@ test('create a new record', function (assert) {
}).then((newDoc) => {
assert.equal(newDoc.data.flavor, 'balsamic', 'should have saved the attribute');

var recordInStore = store().getById('tacoSoup', 'E');
var recordInStore = store().peekRecord('tacoSoup', 'E');
assert.equal(newDoc._rev, recordInStore.get('rev'),
'should have associated the ember-data record with the rev for the new record');

Expand Down Expand Up @@ -177,7 +177,7 @@ test('update an existing record', function (assert) {
}).then((updatedDoc) => {
assert.equal(updatedDoc.data.flavor, 'pork', 'should have updated the attribute');

var recordInStore = store().getById('tacoSoup', 'C');
var recordInStore = store().peekRecord('tacoSoup', 'C');
assert.equal(updatedDoc._rev, recordInStore.get('rev'),
'should have associated the ember-data record with the updated rev');

Expand Down

0 comments on commit b943553

Please sign in to comment.