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

Query containing a join of two paranoia models, only applies paranoia to the parent model #111

Closed
plindelauf opened this issue Feb 12, 2014 · 3 comments

Comments

@plindelauf
Copy link

When both a parent model and a related model have acts_as_paranoia, and I query the parent model with a join statement (e.g. ParentModel.joins(:related_models).where(related_models: { [come criteria] })), the constructed SQL query does contain "related_models".deleted_at IS NULL, and thus all destroyed related_models are taken into account in the query.

See pull request for test case.

@plindelauf
Copy link
Author

Hmmm... sorry... I don't do this a lot. Somehow the commit for this issue got mixed in the pull request for the other issue I reported. Here's the pull request: #110

@moxie
Copy link

moxie commented Aug 11, 2014

This issue appears to have been related to a now resolved ActiveRecord issue. rails/rails#9296 - Encountered this today and learned that the fault did not lie with paranoia.

@radar
Copy link
Collaborator

radar commented Oct 11, 2014

Thanks @moxie. I'll close this issue now.

@radar radar closed this as completed Oct 11, 2014
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