Commit a89c8d93 by Frank Macreery

Always load models, since they may not be autoloaded by Rails

parent 6e80ed22
......@@ -370,7 +370,7 @@ module AnnotateModels
# in subdirectories without namespacing.
def get_model_class(file)
# this is for non-rails projects, which don't get Rails auto-require magic
require File.expand_path("#{model_dir}/#{file}") unless Module.const_defined?(:Rails)
require File.expand_path("#{model_dir}/#{file}")
model_path = file.gsub(/\.rb$/, '')
get_loaded_model(model_path) || get_loaded_model(model_path.split('/').last)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment