Skip to content

Commit

Permalink
Added pushedData hook to root.deleted.uncommitted state.
Browse files Browse the repository at this point in the history
Resolves #3023.
  • Loading branch information
simonexmachina committed May 11, 2015
1 parent 4b44728 commit 556827e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/ember-data/lib/system/model/states.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ var RootState = {
record.triggerLater('ready');
},

pushedData: Ember.K,
becomeDirty: Ember.K,
deleteRecord: Ember.K,

Expand Down
13 changes: 13 additions & 0 deletions packages/ember-data/tests/unit/model-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,19 @@ test("Calling attr(), belongsTo() or hasMany() throws a warning", function() {
});
});

test("supports pushedData in root.deleted.uncommitted", function() {
var record;
var hash = { id: 1 };
run(function() {
record = store.push(Person, hash);
record.deleteRecord();
store.push(Person, hash);
equal(get(record, 'currentState.stateName'), 'root.deleted.uncommitted',
'record accepts pushedData is in root.deleted.uncommitted state');
});
});


module("unit/model - DS.Model updating", {
setup: function() {
array = [{ id: 1, name: "Scumbag Dale" }, { id: 2, name: "Scumbag Katz" }, { id: 3, name: "Scumbag Bryn" }];
Expand Down

0 comments on commit 556827e

Please sign in to comment.