Skip to content

Commit a89c8d9

Browse files
author
Frank Macreery
committed
Always load models, since they may not be autoloaded by Rails
1 parent 6e80ed2 commit a89c8d9

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
@@ -370,7 +370,7 @@ def get_model_files(options)
370370
# in subdirectories without namespacing.
371371
def get_model_class(file)
372372
# this is for non-rails projects, which don't get Rails auto-require magic
373-
require File.expand_path("#{model_dir}/#{file}") unless Module.const_defined?(:Rails)
373+
require File.expand_path("#{model_dir}/#{file}")
374374
model_path = file.gsub(/\.rb$/, '')
375375
get_loaded_model(model_path) || get_loaded_model(model_path.split('/').last)
376376
end

0 commit comments

Comments
 (0)