ankane/searchkick

Ruby 3.0 being overtaken error due to use of class variables

rishijain opened this issue · 1 comments

In ruby 3.0, When a class variable is overtaken by the same definition in an ancestor class/module, a RuntimeError is now raised.
I have a model say User and I am creating another model Customer and User is a superclass for Customer.

If I try to do Customer.class_variable_get(:@@searchkick_options). it raises exception this gives error of class variable in Customer is being overtaken by User.

So running Customer.reindex also fails with same error.

I am wondering if there is a workaround for not using the class_variables or is there a plan to get rid of class_variables. I think in ruby 3.0, Matz himself does not recommend to use class variables.

ankane commented

Hi @rishijain, please use the bug report template to reproduce.