Commit 8004adc7 by Alex Chaffee
parent 935b435e
......@@ -361,8 +361,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}")
require File.expand_path("#{model_dir}/#{file}") unless Module.const_defined?(:Rails)
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