toptal / chewy

High-level Elasticsearch Ruby framework based on the official elasticsearch-ruby client
MIT License
1.88k stars 366 forks source link

Fix `chewy:journal:clean` task for ruby 3.x #874

Closed muk-ai closed 1 year ago

muk-ai commented 1 year ago

This task seems to fails in ruby 3.x because keyword arguments are not expanded.

$ bundle exec rails "chewy:journal:clean"
rails aborted!
ArgumentError: wrong number of arguments (given 1, expected 0)

Tasks: TOP => chewy:journal:clean
(See full trace by running task with --trace)

ruby: 3.0.4 chewy: 7.2.7

I added double splat operator.

konalegi commented 1 year ago

@muk-ai could you please provide a matrix for ruby 3.2 https://github.com/toptal/chewy/blob/master/.github/workflows/ruby.yml#L45?

muk-ai commented 1 year ago

My environment is ruby 3.0.4, I don't think it has anything to do with ruby 3.2.

konalegi commented 1 year ago

ah, ok, right. Although do you think it's still possible to add kind of spec so your solution is tested on CI through all ruby versions that are defined there?

muk-ai commented 1 year ago

@konalegi I wasn't sure if I should add the test to this position, but I added it anyway.

konalegi commented 1 year ago

@muk-ai thanks for the tests, it looks good, could you please fix rubocop issues?

muk-ai commented 1 year ago

@konalegi Thanks for your quick review. fixed.

konalegi commented 1 year ago

sorry, I've forgot (shame on me), could you please provide an entry in the changelog, for example, https://github.com/toptal/chewy/pull/869/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR7-R9

muk-ai commented 1 year ago

@konalegi A changelog was added👍