Skip to content

Commit

Permalink
Merge pull request ctran#50 from eagleas/master
Browse files Browse the repository at this point in the history
fix bug producing "Already memoized" on models
  • Loading branch information
turadg committed Sep 16, 2011
2 parents 9ce1fd6 + 3de59e8 commit cfeec96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/annotate/annotate_models.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ def get_model_files
# Check for namespaced models in subdirectories as well as models
# in subdirectories without namespacing.
def get_model_class(file)
require File.expand_path("#{model_dir}/#{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)

model = ActiveSupport::Inflector.camelize(file.gsub(/\.rb$/, ''))
parts = model.split('::')
begin
Expand Down

0 comments on commit cfeec96

Please sign in to comment.