We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 46dc084 + dd28720 commit 6464fc0Copy full SHA for 6464fc0
lib/annotate/annotate_models.rb
@@ -386,7 +386,8 @@ def get_model_class(file)
386
get_loaded_model(model_path) or raise LoadError.new("cannot load a model from #{file}")
387
rescue LoadError
388
# this is for non-rails projects, which don't get Rails auto-require magic
389
- if Kernel.require(file)
+ file_path = File.expand_path(file)
390
+ if File.file?(file_path) && Kernel.require(file_path)
391
retry
392
elsif model_path.match(/\//)
393
model_path = model_path.split('/')[1..-1].join('/').to_s
0 commit comments