We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
First of all thanks for the great work! I hope I thoroughly checked all created issues so this is no duplicate.
I created a minimal repository with rails new :
See minimal changes in this commit: jalyna/demo-polymorphic-rails61-issue@928fd7b
Basically this test
assert_nil Subscription.find_by(plan: []) # plan is a polymorphic belongs_to association
fails with 6.1.x, resulting in: Unsupported argument type: NilClass. Construct an Arel node instead.
6.1.x
Unsupported argument type: NilClass. Construct an Arel node instead.
I also created a branch using 6.0.3 where the test passes. https://github.com/jalyna/demo-polymorphic-rails61-issue/tree/rails60
6.0.3
This test will pass though (no rows within public_plans):
public_plans
assert_nil Subscription.find_by(plan: PublicPlan.all)
The workaround I'm currently using in my projects is to not trigger a query when the array is empty.
Subscription.find_by(plan: []) # plan is a polymorphic belongs_to association
should return nil
raises: Unsupported argument type: NilClass. Construct an Arel node instead.
Rails version: 6.1.0 & 6.1.1
Ruby version: 2.7.1
The text was updated successfully, but these errors were encountered:
This was fixed with #41063, the same issue was identified in #40951 (comment). There's no release yet though afaik that includes this fix.
Sorry, something went wrong.
@dbussink thank you!
where
Successfully merging a pull request may close this issue.
First of all thanks for the great work! I hope I thoroughly checked all created issues so this is no duplicate.
Steps to reproduce
I created a minimal repository with rails new :
See minimal changes in this commit:
jalyna/demo-polymorphic-rails61-issue@928fd7b
Basically this test
fails with
6.1.x
, resulting in:Unsupported argument type: NilClass. Construct an Arel node instead.
I also created a branch using
6.0.3
where the test passes. https://github.com/jalyna/demo-polymorphic-rails61-issue/tree/rails60This test will pass though (no rows within
public_plans
):The workaround I'm currently using in my projects is to not trigger a query when the array is empty.
Expected behavior
should return nil
Actual behavior
raises:
Unsupported argument type: NilClass. Construct an Arel node instead.
System configuration
Rails version: 6.1.0 & 6.1.1
Ruby version: 2.7.1
The text was updated successfully, but these errors were encountered: