-
Notifications
You must be signed in to change notification settings - Fork 113
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
NameError: uninitialized class variable @@classes in Mongoid::Search #140
Comments
As a workaround, I added this to make sure each model is "touched" which then allows running klass.index_keywords!: mongo_search_models = `find app/models -type f | while read line; do egrep -H "Mongoid::Search" "$line"; done`
mongo_search_models.split("\n").each do |line|
name = line.split(':')[0].split('/')[-1].split('.')[0].capitalize
name.constantize
end
Mongoid::Search.classes.each do |klass|
puts "Indexing Mongoid::Search model: #{klass}"
klass.index_keywords!
end |
Looks like you found this issue in the zeitwerk autoloader rails/rails#37006. @rgaufman can you confirm that running |
When I try to index, I am seeing the following. Any ideas?
I tried both:
and
And the results are the same :(
The text was updated successfully, but these errors were encountered: