diff --git a/README.txt b/README.txt index 5c7313da8..f3adcc65e 100644 --- a/README.txt +++ b/README.txt @@ -2,7 +2,7 @@ Add a comment summarizing the current schema to the top of each ActiveRecord model source file. - # Schema as of Sun Feb 26 21:58:32 CST 2006 (schema version 7) + # == Schema Information # # id :integer(11) not null # quantity :integer(11) @@ -47,4 +47,4 @@ Released under the same license as Ruby. No Support. No Warranty. - Cuong Tran - http://github.com/ctran - Jack Danger - http://github.com/JackDanger - Michael Bumann - http://github.com/bumi - + - Henrik Nyh - http://github.com/henrik diff --git a/lib/annotate_models.rb b/lib/annotate_models.rb index 770b8aef4..46a93c5be 100644 --- a/lib/annotate_models.rb +++ b/lib/annotate_models.rb @@ -46,7 +46,7 @@ def get_schema_info(klass, header) end # Add a schema block to a file. If the file already contains - # a schema info block (a comment starting with "Schema as of ..."), remove it first. + # a schema info block (a comment starting with "== Schema Information"), remove it first. # # === Options (opts) # :position:: where to place the annotated section in fixture or model file, @@ -140,14 +140,18 @@ def do_annotations(options={}) begin klass = get_model_class(file) if klass < ActiveRecord::Base && !klass.abstract_class? - annotated << klass annotate(klass, file, header,options) + annotated << klass end rescue Exception => e puts "Unable to annotate #{file}: #{e.message}" end end - puts "Annotated #{annotated.join(', ')}" + if annotated.empty? + puts "Nothing annotated!" + else + puts "Annotated #{annotated.join(', ')}" + end end def remove_annotations @@ -170,7 +174,7 @@ def remove_annotations puts "Unable to annotate #{file}: #{e.message}" end end - puts "Removed annotaion from: #{deannotated.join(', ')}" + puts "Removed annotation from: #{deannotated.join(', ')}" end end end \ No newline at end of file