This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 183
ActiveRecord queries with :includes do not respect :with_deleted => true #62
Comments
It doesn't work for me also. I don't get undefined method error but it just ignores the "with_deleted" option. @projects = current_user.projects.includes(:users,:stages).where("users.deleted_at IS NOT NULL or users.deleted_at IS NULL") |
having the same problem. would be awesome if this was fixed - cheers! |
Even I have the same problem not sure how to go about it |
+1 |
2 similar comments
+1 |
+1 |
Just hit this today. +1 |
bennibu
added a commit
to foodcoops/foodsoft-archive
that referenced
this issue
Jan 20, 2014
…anoid. See also goncalossilva/acts_as_paranoid#62. Better we remove acts_as_paranoid and filter manually?
+1 |
+1 |
1 similar comment
👍 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I can't see a way around the N+1 problem without using :includes in my Active Record queries. Per the documentation:
However if the following is called in a controller:
The log load statement shows a "('paranoiac_parents'.'deleted_at' IS NULL)" in the WHERE clause resulting in
undefined method
errors. I guess I'm forced to avoid using :includes. Is this behavior by design?The text was updated successfully, but these errors were encountered: