public
Fork of ctran/annotate_models
Description: Annotate ActiveRecord models
Homepage: http://agilewebdevelopment.com/plugins/annotate_models
Clone URL: git://github.com/JackDanger/annotate_models.git
Show 'Nothing to annotate!' instead of 'Annotated ' when there are no 
applicable models.
Typo: 'annotaion' -> 'annotation'.
Don't say that class was annotated if annotation errored out.
Add myself to README credits.
Update README/example to use the schema version-less header.
Rephrase "Nothing to annotate" --> "Nothing annotated"; makes more sense 
if there were none because they failed.
henrik (author)
Sat Apr 26 00:30:50 -0700 2008
ctran (committer)
Fri May 02 21:15:12 -0700 2008
commit  16224621f63794b80caf64fa857cc2b486379611
tree    c8ff4798ec3d543d117e2e4d2cea096fd99d3152
parent  60fc98a2525dbb00374776945e53af67f1c3ccf8
...
2
3
4
5
 
6
7
8
...
47
48
49
50
 
...
2
3
4
 
5
6
7
8
...
47
48
49
 
50
0
@@ -2,7 +2,7 @@
0
 
0
 Add a comment summarizing the current schema to the top of each ActiveRecord model source file.
0
 
0
- # Schema as of Sun Feb 26 21:58:32 CST 2006 (schema version 7)
0
+ # == Schema Information
0
   #
0
   # id :integer(11) not null
0
   # quantity :integer(11)
0
@@ -47,4 +47,4 @@ Released under the same license as Ruby. No Support. No Warranty.
0
  - Cuong Tran - http://github.com/ctran
0
  - Jack Danger - http://github.com/JackDanger
0
  - Michael Bumann - http://github.com/bumi
0
-
0
+ - Henrik Nyh - http://github.com/henrik
...
46
47
48
49
 
50
51
52
...
140
141
142
143
144
 
145
146
147
148
149
150
 
 
 
 
 
151
152
153
...
170
171
172
173
 
174
175
176
177
...
46
47
48
 
49
50
51
52
...
140
141
142
 
143
144
145
146
147
148
149
 
150
151
152
153
154
155
156
157
...
174
175
176
 
177
178
179
180
181
0
@@ -46,7 +46,7 @@ module AnnotateModels
0
     end
0
 
0
     # Add a schema block to a file. If the file already contains
0
- # a schema info block (a comment starting with "Schema as of ..."), remove it first.
0
+ # a schema info block (a comment starting with "== Schema Information"), remove it first.
0
     #
0
     # === Options (opts)
0
     # :position<Symbol>:: where to place the annotated section in fixture or model file,
0
@@ -140,14 +140,18 @@ module AnnotateModels
0
         begin
0
           klass = get_model_class(file)
0
           if klass < ActiveRecord::Base && !klass.abstract_class?
0
- annotated << klass
0
             annotate(klass, file, header,options)
0
+ annotated << klass
0
           end
0
         rescue Exception => e
0
           puts "Unable to annotate #{file}: #{e.message}"
0
         end
0
       end
0
- puts "Annotated #{annotated.join(', ')}"
0
+ if annotated.empty?
0
+ puts "Nothing annotated!"
0
+ else
0
+ puts "Annotated #{annotated.join(', ')}"
0
+ end
0
     end
0
     
0
     def remove_annotations
0
@@ -170,7 +174,7 @@ module AnnotateModels
0
           puts "Unable to annotate #{file}: #{e.message}"
0
         end
0
       end
0
- puts "Removed annotaion from: #{deannotated.join(', ')}"
0
+ puts "Removed annotation from: #{deannotated.join(', ')}"
0
     end
0
   end
0
 end
0
\ No newline at end of file

Comments

    No one has commented yet.