question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide example of using bufferedProxy on records with relationships

See original GitHub issue

Hi! Thank you for you your awesome project.

I wonder whether i can use ember-buffered-proxy on Ember Data records.

My use case:

  1. A record is created clientside when a user visits the route. The record will eventually be persisted to the backend, but during this use case it does not.
  2. The user opens a modal dialog with an edit form, edits the record and presses OK in the form to close the dialog. From the user perspective, he has kinda saved his edits, and the record is now in state A.
  3. The user can open the form and edit the record again. The record is now is in state B. If he messes up, he should be able to discard his edits by pressing Cancel instead of OK. I cannot use .rollback() because it will revert the unsaved record to a tabula rasa state, while the user expects it to be reverted to state A.

My problem is that the record in question does not store much data itself: all its data comes from related child and grandchild records.

Does this mean that i have to apply discardBufferedChanges recursively? Is there a simpler way?

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lolmauscommented, Apr 17, 2015

I struggle to figure out how to do that. Can you please provide an example?

I think using bufferedProxy on records is a popular use case and a publicly available example will be very useful.

0reactions
reminocommented, Jan 31, 2016

Having an example on how to use this on a model would be great. I’m also struggling with this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · yapplabs/ember-buffered-proxy - GitHub
Contribute to yapplabs/ember-buffered-proxy development by creating ... Provide example of using bufferedProxy on records with relationships.
Read more >
Guide to table relationships - Microsoft Support
A one-to-many relationship. Let's use an order tracking database that includes a Customers table and an Orders table as an example.
Read more >
Considerations for Relationships - Salesforce Help
You can create a relationship from an object to itself, but it must be a lookup relationship, and a single record can't be...
Read more >
Add Record Type Relationships - Appian 21.2
For example, let's say that the Customer and Order record types are related, and in the database tables that they use, the Order...
Read more >
Many-to-many relationships
A many-to-many relationship occurs when multiple records in a table are associated with ... Using the example above, create a table named Enrollments....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found