From 6a4f60145adc508f622b9dc096b6a57e80afc93a Mon Sep 17 00:00:00 2001 From: Dan Carr Date: Tue, 14 Jul 2015 13:31:54 -0700 Subject: [PATCH] set HasMany isLoaded to true after loading content --- packages/ember-model/lib/has_many_array.js | 1 + packages/ember-model/tests/has_many/objects_load_test.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ember-model/lib/has_many_array.js b/packages/ember-model/lib/has_many_array.js index 0e8d80d..f9f56a5 100644 --- a/packages/ember-model/lib/has_many_array.js +++ b/packages/ember-model/lib/has_many_array.js @@ -128,6 +128,7 @@ Ember.ManyArray = Ember.RecordArray.extend({ originalContent: content.slice() }); set(this, '_modifiedRecords', []); + this.notifyLoaded(); }, revert: function() { diff --git a/packages/ember-model/tests/has_many/objects_load_test.js b/packages/ember-model/tests/has_many/objects_load_test.js index c58a44b..f76344f 100644 --- a/packages/ember-model/tests/has_many/objects_load_test.js +++ b/packages/ember-model/tests/has_many/objects_load_test.js @@ -3,7 +3,7 @@ var attr = Ember.attr; module("Ember.HasManyArray - objects loading"); test("loads objects based on their ids", function() { - expect(5); + expect(6); var json = { id: 1, @@ -45,5 +45,6 @@ test("loads objects based on their ids", function() { ok(Ember.run(comments, comments.get, 'firstObject') instanceof Comment, "The first object is a Comment object"); deepEqual(Ember.run(comments, comments.mapProperty, 'text'), ['uno', 'dos', 'tres'], "The comments are loaded"); ok(!comments.everyProperty('isNew'), "Records should not be new"); + ok(comments.get('isLoaded'), "Sets isLoaded to true"); }); });