Commit ba5d1cc0 by Michael Fernando

Check if model has skip tag in annotate_model_file

Potentially addresses issue# #167 Annotate_model_file is called automatically on all files in models directory and does not check if model contains SkipSchemaAnnotations tag.
parent bc2662b4
......@@ -477,6 +477,7 @@ module AnnotateModels
def annotate_model_file(annotated, file, header, options)
begin
return false if (/# -\*- SkipSchemaAnnotations.*/ =~ (File.exist?(file) ? File.read(file) : '') )
klass = get_model_class(file)
if klass && klass < ActiveRecord::Base && !klass.abstract_class? && klass.table_exists?
if annotate(klass, file, header, options)
......
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