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

recover! method raises validation error even if record is valid. Using recover works properly #279

Open
rohitjoshixyz opened this issue Apr 20, 2022 · 0 comments

Comments

@rohitjoshixyz
Copy link

rohitjoshixyz commented Apr 20, 2022

Version: 0.7.0
I have acts_as_paranoid set in the CommunityMember model. There is a soft deleted record present in DB with ID 2673197

irb(main):002:0> cm = CommunityMember.with_deleted.find 2673197
=> #<CommunityMember id: 2673197, community_id: 24922, user_id: 234, created_at: "2021-12-28 03:10:45.431833000 +0000", deleted_at: "2022-04-14 04:02:13.000000000 +0000>
irb(main):003:0> cm.valid?
=> true
irb(main):004:0> cm.recover!
Traceback (most recent call last):
        1: from (irb):4
ActiveRecord::RecordInvalid (Validation failed: Community member must exist, Community member can't be blank)
irb(main):005:0> cm.recover
=> true

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

1 participant