@@ -9,7 +9,7 @@ module AnnotateModels
99 END_MARK = "== Schema Information End"
1010 PATTERN = /^\r ?\n ?# (?:#{ COMPAT_PREFIX } |#{ COMPAT_PREFIX_MD } ).*?\r ?\n (#.*\r ?\n )*(\r ?\n )*/
1111
12- MATCHED_TYPES = %w( test fixture factory serializer scaffold controller )
12+ MATCHED_TYPES = %w( test fixture factory serializer scaffold controller helper )
1313
1414 # File.join for windows reverse bar compat?
1515 # I dont use windows, can`t test
@@ -49,6 +49,9 @@ module AnnotateModels
4949 # Controller files
5050 CONTROLLER_DIR = File . join ( "app" , "controllers" )
5151
52+ # Helper files
53+ HELPER_DIR = File . join ( "app" , "helpers" )
54+
5255 # Don't show limit (#) on these column types
5356 # Example: show "integer" instead of "integer(4)"
5457 NO_LIMIT_COL_TYPES = [ "integer" , "boolean" ]
@@ -118,6 +121,10 @@ def get_patterns(pattern_types=MATCHED_TYPES)
118121 [
119122 File . join ( root_directory , CONTROLLER_DIR , "%PLURALIZED_MODEL_NAME%_controller.rb" )
120123 ]
124+ when 'helper'
125+ [
126+ File . join ( root_directory , HELPER_DIR , "%PLURALIZED_MODEL_NAME%_helper.rb" )
127+ ]
121128 end
122129 end
123130 end
@@ -389,6 +396,7 @@ def remove_annotation_of_file(file_name)
389396 # :exclude_serializers<Symbol>:: whether to skip modification of serializer files
390397 # :exclude_scaffolds<Symbol>:: whether to skip modification of scaffold files
391398 # :exclude_controllers<Symbol>:: whether to skip modification of controller files
399+ # :exclude_helpers<Symbol>:: whether to skip modification of helper files
392400 #
393401 def annotate ( klass , file , header , options = { } )
394402 begin
0 commit comments