Commit 3738206b by Alex Chaffee

expand path (to help prevent double-require warnings)

parent aba79ef7
...@@ -182,7 +182,7 @@ module AnnotateModels ...@@ -182,7 +182,7 @@ module AnnotateModels
# Check for namespaced models in subdirectories as well as models # Check for namespaced models in subdirectories as well as models
# in subdirectories without namespacing. # in subdirectories without namespacing.
def get_model_class(file) def get_model_class(file)
require "#{model_dir}/#{file}" # this is for non-rails projects, which don't get Rails auto-require magic require File.expand_path("#{model_dir}/#{file}") # this is for non-rails projects, which don't get Rails auto-require magic
model = file.gsub(/\.rb$/, '').camelize model = file.gsub(/\.rb$/, '').camelize
parts = model.split('::') parts = model.split('::')
begin begin
......
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