-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dont remove deleted but uncommited records from record arrays #3247
Dont remove deleted but uncommited records from record arrays #3247
Conversation
@@ -60,7 +60,8 @@ export default Ember.Object.extend({ | |||
*/ | |||
updateRecordArrays: function() { | |||
forEach(this.changedRecords, function(record) { | |||
if (record.isDeleted()) { | |||
// TODO: it can be refactored after #2862 && #2859 are closed | |||
if (get(record, 'record.isDestroyed') || get(record, 'record.isDestroying') || (record.isDeleted() && !record.isDirty())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the updated PR for the work done in #2867 |
Before this commit records were deleted from record arrays just after deleting them, but before they were commited. This can be an issue if you want to keep records visible in the UI until they're actually removed.
…eteRecord - Removed disconnectRelationship method calls from model/states.js - Removed reconnectRelationships from modle/internal-model.js - Remove one-sided disconnect and reconnect relationship methods - Removed method definitions in internal-model for: - disconnectRelationships - reconnectRelationships - Removed method definitions in relationship for: - disconnect - reconnect - addRecordToInverse - Fixed incorrect tests
7b44c3e
to
a8599de
Compare
|
||
// drogus' attempt | ||
// if (get(record, 'record.isDestroyed') || get(record, 'record.isDestroying') || (record.isDeleted() && !record.isDirty())) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@igorT here is where I was talking about
Hi @ianstarz. Thanks for this work. I ended up taking a stab at this too. #3539 For the I also left the |
@bmac it seemed like inspecting the state path was the right way to go. Thanks for picking this up! I'm still getting familiar with the code base, and was feeling pretty stuck. |
Before this commit records were deleted from record arrays just after
deleting them, but before they were committed. This can be an issue if
you want to keep records visible in the UI until they're actually
removed.