Skip to content

Commit c24f64c

Browse files
pbolingctran
authored andcommitted
Allow use of the fallback loading solution (#473)
LoadError does not descend from `StandardError` so the fallback loading is never invoked. ``` >> LoadError.ancestors => [LoadError, ScriptError, Exception, Object, Kernel, BasicObject] ```
1 parent 9f3e2b7 commit c24f64c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/annotate/annotate_models.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def get_model_class(file)
613613
# Retrieve loaded model class by path to the file where it's supposed to be defined.
614614
def get_loaded_model(model_path)
615615
ActiveSupport::Inflector.constantize(ActiveSupport::Inflector.camelize(model_path))
616-
rescue
616+
rescue StandardError, LoadError
617617
# Revert to the old way but it is not really robust
618618
ObjectSpace.each_object(::Class)
619619
.select do |c|

0 commit comments

Comments
 (0)