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 935b435 commit 8004adcCopy full SHA for 8004adc
lib/annotate/annotate_models.rb
@@ -361,8 +361,7 @@ def get_model_files(options)
361
# in subdirectories without namespacing.
362
def get_model_class(file)
363
# this is for non-rails projects, which don't get Rails auto-require magic
364
- require File.expand_path("#{model_dir}/#{file}")
365
-
+ require File.expand_path("#{model_dir}/#{file}") unless Module.const_defined?(:Rails)
366
model_path = file.gsub(/\.rb$/, '')
367
get_loaded_model(model_path) || get_loaded_model(model_path.split('/').last)
368
end
0 commit comments