Closed dunn closed 6 years ago
This is too heavy handed, loading every vocabulary in spite of use will use a massive amount of memory. I'm fine with using absolute paths to the libraries, but not changing autoload
to require
.
It does seem that Rails creates an autoload race condition (see https://stackoverflow.com/questions/29439323/rails-4-2-autoloading-not-thread-safe).
Some alternatives would be to create a load_all
class module method which would do the require, and could be done early in Rails configuration, or to simply whitelist the vocabularies you rely on and cause them to autoload on initialization.
A note in the README about this issue, and hopeful resolution, would be useful.
Interestingly, passing the full path to autoload
also seems to work. PR updated.
I’ll release soon.
Due to quirks in Rails' autoloading behavior, currently some vocabularies can fail to be loaded, leading to curious situations like this: