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

Calling delete then recover on the same object doesn't recover has_many/dependent relationships #253

Open
catphobia opened this issue Oct 13, 2021 · 2 comments
Assignees

Comments

@catphobia
Copy link

Using rails 6.0 e.g.

class Post
  acts_as_paranoid
  has_many :comments, dependent: :destroy
end

class Comments
  acts_as_paranoid
  belongs_to :post
end

post = Post.find 1
post.destroy # safe deletes the post and the comment(s)
post.recover # recovers the post, but the comment(s) are still deleted

# if, instead, we simply fetch a new Post object and try calling recover it'll work
post_2 = Post.find 1
post_2.recover # recovers all comments
@turnon
Copy link

turnon commented Oct 27, 2021

And the version of this gem ?

@catphobia
Copy link
Author

@turnon 0.7.3

@mvz mvz self-assigned this Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants