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

only_deleted doesn't work sometimes(?) #283

Open
pboling opened this issue Jun 10, 2022 · 0 comments
Open

only_deleted doesn't work sometimes(?) #283

pboling opened this issue Jun 10, 2022 · 0 comments

Comments

@pboling
Copy link

pboling commented Jun 10, 2022

I am not sure what causes this, but here is the symptom of the problem:

[31] pry(main)> p.email_messages.only_deleted.count
=> 0
[32] pry(main)> p.email_messages.with_deleted.count
=> 320
[33] pry(main)> p.email_messages.count
=> 157

I would expect only_deleted + natural = with_deleted. There are truly that number of deleted records, but when using only_deleted the count is 0.

This is my first attempt to use only_deleted, so maybe it doesn't work all the time... Don't know. The relationship isn't a basic has_many, but a has_many :through, and that may be relevant.

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

1 participant