Allow `get_loaded_model` to succeed when `$LOAD_PATH` contains non-string values (#848)
As currently implemented, `get_loaded_model` inspects the `$LOAD_PATH` global for path values when trying to find the path for a model file. This would be fine, except that variable is affected by userspace, which means that it will sometimes contain non-string values, often Pathnames. To avoid responding with the error `Unable to annotate #{model_path}: no implicit conversion of Pathname into String` in this situation, we simply add an explicit `to_s` call before performing string-specific operations.
Fixes https://github.com/ctran/annotate_models/issues/758
Showing
Please
register
or
sign in
to comment