ember.js - Why does Ember complain when pushing an object onto an Ember array? -
i using ember rc6.1 ember model. when set adapter property of model class instance of ember model's restadpater class , perform findall, assertion thrown each object added resulting ember array. stack trace shows object pushed onto array, inserted, , replaced. not sure why latter (replacing) occurs. might result of implicit sort.
for each push, assertion thrown stating content property of instance of recordarray (which inherits arrayproxy) should set before modifying it.
assertion failed: content property of ember.recordarray should set before modifying the resulting array behaves normally, wondering if bug in ember model or ember itself. assume code not responsible bug nothing out of ordinary aside fetching data api per documentation of ember model.
i have added stack trace below.
(anonymous function) application.js:6108 ember.assert application.js:5799 ember.arrayproxy.ember.object.extend._replace application.js:17977 ember.arrayproxy.ember.object.extend._insertat application.js:17992 ember.arrayproxy.ember.object.extend.pushobject application.js:18036 superwrapper application.js:6826 ember.model.reopenclass.addtorecordarrays application.js:5251 (anonymous function) application.js:5242 sendevent application.js:7843 ember.evented.ember.mixin.create.trigger application.js:16867 ember.model.ember.object.extend.load application.js:4792 ember.model.reopenclass.findfromcacheorload application.js:5280 (anonymous function) application.js:4453 ember.recordarray.ember.arrayproxy.extend.materializedata application.js:4452 ember.recordarray.ember.arrayproxy.extend.load application.js:4435 ember.restadapter.ember.adapter.extend.didfindall application.js:5585 (anonymous function) application.js:5576 invokecallback application.js:12843 (anonymous function) application.js:12886 eventtarget.trigger application.js:12674 (anonymous function) application.js:12941 deferredactionqueues.flush application.js:10648 backburner.end application.js:10338 backburner.run application.js:10377 ember.run application.js:10859 settings.success application.js:5697 fire application.js:38117 self.firewith application.js:38228 done application.js:45154 callback update: call pushobject performed ember model. have added implementation of addtorecordarrays, method in record added instance of recordarray.
addtorecordarrays: function(record) { if (this._findallrecordarray) { this._findallrecordarray.pushobject(record); } if (this.recordarrays) { this.recordarrays.foreach(function(recordarray) { recordarray.pushobject(record); }); } }
i've reverted commit introduced issue.
Comments
Post a Comment