-
Notifications
You must be signed in to change notification settings - Fork 529
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
Incorrect counts and records returned for associated models #479
Labels
Comments
I've found that I can workaround the issue by changing my class Child < ApplicationRecord
acts_as_paranoid without_default_scope: true
default_scope {where(deleted_at: [nil, ''])}
...
end Any idea why that would be? |
Do you use recursive delete ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rails 5.1.6, Ruby 2.4.3, paranoia 2.4.1. MySQL 5.7
I have the following model setup:
I'm seeing issues when trying to do get the associated children records for a given parent:
One record in the
associated_children
collection is soft-deleted, but the others are not.So there should be 32 records returned for
associated_children
, but instead I see:The kicker is this is only happening on 1 table of my database, and only on production. When I copy the production database locally the exact same queries as above work just fine for the same models that are failing on production.
The text was updated successfully, but these errors were encountered: