Skip to content

Commit

Permalink
Explicitly set length after setting a new content property
Browse files Browse the repository at this point in the history
This is a workaround for emberjs/ember.js#12218
  • Loading branch information
bmac committed Aug 27, 2015
1 parent 9485564 commit 67f14b8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/ember-data/lib/system/model/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,13 @@ export default Ember.ArrayProxy.extend(Ember.Evented, {
if (get(this, 'isEmpty')) { return; }

let content = this.rejectBy('attribute', attribute);
let length = get(content, 'length');
set(this, 'content', content);
// Explicitly set length after setting a new content property as
// a work around for https://github.com/emberjs/ember.js/pull/12218
if (this.get('length') !== length) {
this.set('length', length);
}
get(this, 'errorsByAttributeName').delete(attribute);

this.notifyPropertyChange(attribute);
Expand Down

0 comments on commit 67f14b8

Please sign in to comment.