Skip to content
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

Only recover records that have been destroyed through dependent: :destroy callback? #359

Closed
jawa opened this issue Sep 30, 2016 · 4 comments · Fixed by fsek/web#743
Closed

Comments

@jawa
Copy link

jawa commented Sep 30, 2016

Hi, thanks for a great gem!

I'm sorry if this has been discussed earlier, but I couldn't find anything about it. The feature that I miss the most in this library is to be able to recursively restore only objects that have been destroyed through the depent: :destroy callback.

The acts_as_paranoid gem seems to have this feature and I wonder if there are any reasons for paranoia not to have it?

I'd like to help to work on a solution for this if there is interest in it.

@konto-andrzeja
Copy link
Contributor

Something like User.restore(user_id, recursive: true) doesn't work for you? Or have I misunderstood your question?

@jawa
Copy link
Author

jawa commented Feb 13, 2017

The use case that I am thinking of is when there is a has many association and a child object is destroyed first, then later the parent object is destroyed (and the rest of the children). When the parent is restored with the children, the child that was first destroyed should not be restored.

@konto-andrzeja
Copy link
Contributor

Does this fork solve your problem?

@jawa
Copy link
Author

jawa commented Feb 20, 2017

Yes, it seems to do what I was looking for! Nice :-)

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

Successfully merging a pull request may close this issue.

3 participants