Skip to content

Commit

Permalink
Update annotate_models.rb
Browse files Browse the repository at this point in the history
Potentially addresses issue# ctran#167
Annotate_model_file is called automatically on all files in models directory and does not check if model contains SkipSchemaAnnotations tag.
  • Loading branch information
mafernando committed Mar 29, 2015
1 parent bc2662b commit 4dcee10
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/annotate/annotate_models.rb
Expand Up @@ -477,6 +477,8 @@ def do_annotations(options={})

def annotate_model_file(annotated, file, header, options)
begin
old_content = File.read(file) # Check model file for SkipSchemaAnnotations
return false if(old_content =~ /# -\*- SkipSchemaAnnotations.*\n/)
klass = get_model_class(file)
if klass && klass < ActiveRecord::Base && !klass.abstract_class? && klass.table_exists?
if annotate(klass, file, header, options)
Expand Down

0 comments on commit 4dcee10

Please sign in to comment.