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

Make slug works fine with Mongoid::Paranoia #107

Closed
sadjow opened this issue Jan 25, 2013 · 7 comments
Closed

Make slug works fine with Mongoid::Paranoia #107

sadjow opened this issue Jan 25, 2013 · 7 comments

Comments

@sadjow
Copy link

sadjow commented Jan 25, 2013

The slug query is fiding the deleted document when using with Mongoid::Paranoia

@digitalplaywright
Copy link
Collaborator

Sorry for the delay. I'll look into this issue shortly.

@jhoffner
Copy link

This tricky issue just popped up for me as well. If you can point me in the right direction I can take a look.

@digitalplaywright
Copy link
Collaborator

@jhoffner Thank you for offering to take a look at this problem. The only file that needs changes is:

However, since Mongoid Paranoia is being moved out of Mongoid core in 4.0 the solution needs to work even if Mongoid Paranoia is not present. A solution might be to exclude documents that have the delete_at field set, since I believe Paranoid documents are marked using that field. Please let me know what you think.

@digitalplaywright
Copy link
Collaborator

@jhoffner The only method that needs to be changed is 'for_slugs(..)' and I think it is reasonable that Mongoid Slug is changed to never return any deleted documents.

@simi
Copy link
Contributor

simi commented Feb 23, 2013

According to simi/mongoid_paranoia#1 (comment), feel free to add test cases to test project. I made some basic specs and it works.

@digitalplaywright
Copy link
Collaborator

@simi Sorry for not checking this better. I should have done a better job here. I can not at this point reproduce test-cases where Mongoid Slug fails with Mongoid Paranoia.

@jhoffner @sadjow I've added the test cases from @simi to Mongoid Slug master. Could you please either

@digitalplaywright
Copy link
Collaborator

@jhoffner @sadjow I am closing this issue for now since we can not reproduce the problem. We will reopen this issue in the future if this changes. Please let us know if you are still experiencing this issue.

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

4 participants