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
Using AR::Base.none in subquery results with no condition unexpectedly #15176
Comments
@PikachuEXE can you please attach an executable test-case to reproduce? You can use this script as a starting point. |
OK here it is: |
thank you 💛 l |
This issue has been automatically marked as stale because it has not been commented on for at least The resources of the Rails team are limited, and so we are asking for your help. If you can still reproduce this error on the Thank you for all your contributions. |
@senny Do you have all the information you need? |
I'm experiencing this issue too! I'm using where('1 = 0') as a workaround. |
I am also using the same where('1 = 0') workaround in my project to avoid this bug |
[Matthew Draper & Yves Senn]
[Matthew Draper & Yves Senn] Closes rails#16860. (pull request to discuss the implementation)
[Matthew Draper & Yves Senn] Closes #16860. Conflicts: activerecord/CHANGELOG.md
Listing.none.count
=>0
Expected:
Parent.listings.where(id: Listing.none).count
=>0
Actual:
Parent.listings.where(id: Listing.none).count
=>all_record_count
The text was updated successfully, but these errors were encountered: