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

Rails 6.1: where.not raises ArgumentError: Unsupported argument type: chain (Symbol) #44926

Closed
guillaumebriday opened this issue Apr 20, 2022 · 2 comments

Comments

@guillaumebriday
Copy link
Member

guillaumebriday commented Apr 20, 2022

Steps to reproduce

After upgrading from Rails 6.0 to Rails 6.1, I have this error when using a simple where.not.

I have no idea why but it seems to be raised at this line: https://github.com/rails/rails/blob/6-1-stable/activerecord/lib/active_record/relation/query_methods.rb#L1097

In my example, the parameter opts is equal to :chain in Rails 6.1 and {:id => 5} in Rails 6.0. That is why it raises an error.

Any idea why? Thanks in advance

Expected behavior

Status.where.not(id: 5)
#=> []

Actual behavior

Status.where.not(id: 5)
#=> ArgumentError: Unsupported argument type: chain (Symbol)

System configuration

Rails version: 6.1.5

Ruby version: 2.7.6

I'm using config.autoloader = :classic I'm not sure if it could have an impact...

@eileencodes
Copy link
Member

Hey @guillaumebriday, thanks for opening na issue. Unfortunately there's not enough information here to determine what's wrong - the where.not in active record appears to be working correctly. Can you try making a new application that reproduces the bug?

@eileencodes eileencodes added activerecord more-information-needed When reporter needs to provide more information labels Apr 20, 2022
@guillaumebriday
Copy link
Member Author

Hey @eileencodes and thanks for your quick reply

Actually, I think it's not a Rails issue but a bug from awesome_hstore_translate that I use in one of my project. See: openscript/awesome_hstore_translate#17

The signature of some methods has change between Rails 6.0 and Rails 6.1. That is why it's incompatible.

We can close the issue here, thanks again!

@rails-bot rails-bot bot removed the more-information-needed When reporter needs to provide more information label Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants