Skip to content

Commit

Permalink
Merge pull request emberjs#577 from tchak/resolve-new-records
Browse files Browse the repository at this point in the history
new records should resolve the promise
  • Loading branch information
wycats committed Jan 4, 2013
2 parents a72ed12 + 5278ae9 commit 508479d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/ember-data/lib/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,9 @@ DS.Store = Ember.Object.extend(DS._Mappable, {
// Set the properties specified on the record.
record.setProperties(properties);

// Resolve record promise
Ember.run(record, 'resolve', record);

return record;
},

Expand Down
2 changes: 2 additions & 0 deletions packages/ember-data/tests/unit/store_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ test("all(type) returns a record array of all records of a specific type", funct
});

test("a new record of a particular type is created via store.createRecord(type)", function() {
expect(6);
var store = DS.Store.create();
var Person = DS.Model.extend({
name: DS.attr('string')
Expand All @@ -409,6 +410,7 @@ test("a new record of a particular type is created via store.createRecord(type)"
});

test("an initial data hash can be provided via store.createRecord(type, hash)", function() {
expect(6);
var store = DS.Store.create();
var Person = DS.Model.extend({
name: DS.attr('string')
Expand Down

0 comments on commit 508479d

Please sign in to comment.