Permalink
Browse files

new records should resolve the promise

  • Loading branch information...
1 parent a72ed12 commit 5278ae9d830cd93ffba73ab0ebf89dab8db3638e @tchak tchak committed Jan 4, 2013
Showing with 5 additions and 0 deletions.
  1. +3 −0 packages/ember-data/lib/system/store.js
  2. +2 −0 packages/ember-data/tests/unit/store_test.js
View
3 packages/ember-data/lib/system/store.js
@@ -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;
},
View
2 packages/ember-data/tests/unit/store_test.js
@@ -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')
@@ -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')

0 comments on commit 5278ae9

Please sign in to comment.