Skip to content

Conversation

@harryhlai
Copy link

When an object and its associated objects have been soft deleted, the associations return empty collections and nil because of the default scoping. The logic for restore correctly handles this, but the logic for really_destroy (for an object that has already been soft deleted) fails for has_one associations. To see an example of this failing, look at the test case added in this PR; that test case fails with the current core branch.

This PR fixes that by refactoring the logic used in restore, and re-using it for really_destroy.

@harryhlai harryhlai changed the title Fixed bug with really_destroy! after destroy and has_ones. Fixed has_one bug with really_destroy! after destroy Nov 3, 2017
… logic in #restore_associated_records and leverage it for really_destroy.
@mathieujobin
Copy link
Collaborator

I am only seeing this now... I resolved the conflict simply by keeping both sides.
@harryhlai do you think it still makes sense to merge this?
can you update and see why the tests are failing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants