Commit 2eb9714b by Cuong Tran

Merge pull request #161 from fancyremarker/aptible

Always load models, since they may not be autoloaded by Rails
parents 6e80ed22 a89c8d93
...@@ -370,7 +370,7 @@ module AnnotateModels ...@@ -370,7 +370,7 @@ module AnnotateModels
# in subdirectories without namespacing. # in subdirectories without namespacing.
def get_model_class(file) def get_model_class(file)
# this is for non-rails projects, which don't get Rails auto-require magic # 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$/, '') model_path = file.gsub(/\.rb$/, '')
get_loaded_model(model_path) || get_loaded_model(model_path.split('/').last) get_loaded_model(model_path) || get_loaded_model(model_path.split('/').last)
end 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