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.
1 parent c0aa6ca commit 96831c1Copy full SHA for 96831c1
lib/annotate/annotate_models.rb
@@ -584,6 +584,10 @@ def get_model_class(file)
584
begin
585
get_loaded_model(model_path, file) || raise(BadModelFileError.new)
586
rescue LoadError
587
+ if model_path.include?("models/")
588
+ model_path = model_path.gsub(/models\//, '')
589
+ retry
590
+ end
591
# this is for non-rails projects, which don't get Rails auto-require magic
592
file_path = File.expand_path(file)
593
if File.file?(file_path) && Kernel.require(file_path)
0 commit comments