You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working heavily ember-model (store-less version) for the past 6-8 months and have learned a great deal. I thought that it might be good to find points where ember-model might fail due to user error.
For example I constantly run into issues with HasManyEmbedded objects where I am incorrectly setting properties on a model and the model fails to materialize. The most common error I see with ember-model is:
Ember.EmbeddedHasManyArray=Ember.ManyArray.extend({materializeRecord: function(idx){varklass=get(this,'modelClass'),primaryKey=get(klass,'primaryKey'),content=get(this,'content'),reference=content.objectAt(idx),attrs;if(reference!==undefined){attrs=reference.data;}else{thrownewError('There was a problem with materializeRecord() on '+klass);}if(reference.record){returnreference.record;}else{varrecord=klass.create({_reference: reference});reference.record=record;if(attrs){record.load(attrs[primaryKey],attrs);}returnrecord;}},});
Above I added a check on the reference and to throw an error with the model with an issue so I know exactly where to start looking. Is this the best way to go about better informing the user?
The text was updated successfully, but these errors were encountered:
I've been working heavily ember-model (store-less version) for the past 6-8 months and have learned a great deal. I thought that it might be good to find points where ember-model might fail due to user error.
For example I constantly run into issues with HasManyEmbedded objects where I am incorrectly setting properties on a model and the model fails to materialize. The most common error I see with ember-model is:
It's when the model is attempting to materialize:
Above I added a check on the reference and to throw an error with the model with an issue so I know exactly where to start looking. Is this the best way to go about better informing the user?
The text was updated successfully, but these errors were encountered: