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

There should be a scope for finding deleted objects #13

Open
NullVoxPopuli opened this issue Sep 2, 2013 · 2 comments
Open

There should be a scope for finding deleted objects #13

NullVoxPopuli opened this issue Sep 2, 2013 · 2 comments

Comments

@NullVoxPopuli
Copy link

Instead of (or in addition to) Object.with_deleted { current_user.objects.find(...) }

We should have:
current_user.objects.with_deleted.find(...)

I was looking in https://github.com/sricc/soft_deletion/blob/master/lib/soft_deletion/core.rb

and it looks like you could just add this:

scope :with_deleted, -> {
    unscoped {}
}

Note: I'm using Ruby 2.0, and Rails 4

@grosser
Copy link
Owner

grosser commented Sep 3, 2013

Can you make it a PR ?
It's fine if it does not work on all versions, we can put a if AR::VERSION::MAJOR > x around it

@NullVoxPopuli
Copy link
Author

I don't really have time at the moment.

My temp fix was just to add that scope to my model.

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

2 participants