Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set HasMany isLoaded to true after loading content #430

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/ember-model/lib/has_many_array.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ Ember.ManyArray = Ember.RecordArray.extend({
originalContent: content.slice()
});
set(this, '_modifiedRecords', []);
this.notifyLoaded();
},

revert: function() {
Expand Down
3 changes: 2 additions & 1 deletion packages/ember-model/tests/has_many/objects_load_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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");
});
});