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
Thanks for your great library - Backbone-relational. I'm using it quite extensively in a project and I came across is very interesting scenario that seems to be a bug.
I had some models which had other related models rendered on a webpage. If I make any changes to the models (from the database) and I refresh the collection, this gets reflected on the interface however, if I make the changes to a related model (again from the backend) and refresh the collection, this related model doesn't reflect the new changes. I traced this to https://github.com/PaulUithol/Backbone-relational/blob/master/backbone-relational.js#L484 (line 484). My hack was to avoid the lookup in the store and create the model each time.
Are there any better ways to solve this problem, is my solution going to have any performance hits on my application?
Thanks.
The text was updated successfully, but these errors were encountered:
However, the related models in your scenario indeed pass through findRelated, which causes them to be used just as they're found in the store. The behavior there should probably mimic that in the overridden collection._add; update if found in the store, create otherwise. I'll see if I can fix this.
Raised by @takinbo in email:
Thanks for your great library - Backbone-relational. I'm using it quite extensively in a project and I came across is very interesting scenario that seems to be a bug.
I had some models which had other related models rendered on a webpage. If I make any changes to the models (from the database) and I refresh the collection, this gets reflected on the interface however, if I make the changes to a related model (again from the backend) and refresh the collection, this related model doesn't reflect the new changes. I traced this to https://github.com/PaulUithol/Backbone-relational/blob/master/backbone-relational.js#L484 (line 484). My hack was to avoid the lookup in the store and create the model each time.
Are there any better ways to solve this problem, is my solution going to have any performance hits on my application?
Thanks.
The text was updated successfully, but these errors were encountered: