Skip to content

Commit

Permalink
Merge pull request emberjs#3711 from bmac/workaround-ember-12218
Browse files Browse the repository at this point in the history
Explicitly set length after setting a new content property
  • Loading branch information
fivetanley committed Aug 28, 2015
2 parents 6d731f6 + 67f14b8 commit 0268cc3
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 0268cc3

Please sign in to comment.