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

upmin doesn't play particularly well with the paranoia gem #176

Open
apurvis opened this issue Aug 27, 2015 · 1 comment
Open

upmin doesn't play particularly well with the paranoia gem #176

apurvis opened this issue Aug 27, 2015 · 1 comment

Comments

@apurvis
Copy link

apurvis commented Aug 27, 2015

If I use upmin to update a user's deleted_at, i get an error as soon as i save the record because the paranoia gem prevents the record from being found.

Then there is the matter that the deleted record can't be found through upmin at all... and the main reason I ended up using upmin in the first place was because I was hoping to give some less than technically savvy people a way to undo record deletion by manually removing deleted_at values from records.

Definitely not a bug but would be a nice option - to be able to even view and edit records that have deleted_at IS NOT NULL

I can't seem to label this issue but it's definitely an enhancement request and not a bug.

@mbrookes
Copy link
Contributor

Looking at the paranoia docs, I'm not seeing anay stragforward wy to achieve this within Upmin, and it's also quite specifc to this particular soft-delete gem, so possibly out of scope.

If you want to give it a go local to your project, you could try cloning:
https://github.com/upmin/upmin-admin-ruby/blob/master/app/controllers/upmin/models_controller.rb
into your Rails app (see customization in the wiki for details), and change the relevant actions to chain paranoia's .with_deleted method.

This would apply to all models though, and not sure how paranoia behaves for models without a deleted_at column. (ideally it should pass the request though as .all or whatever).

Let us know how it goes!

Edit: Also, if you get to the point where you can successfully find a deleted record, you will be able to customise the view to add an undelete button for deleted records.

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

No branches or pull requests

2 participants