diff --git a/lib/annotate/annotate_models.rb b/lib/annotate/annotate_models.rb index 7c74f96ea..17c7e828a 100644 --- a/lib/annotate/annotate_models.rb +++ b/lib/annotate/annotate_models.rb @@ -222,7 +222,7 @@ def annotate_one_file(file_name, info_block, position, options={}) old_header = old_content.match(header_pattern).to_s new_header = info_block.match(header_pattern).to_s - column_pattern = /^#[\t ]+\w+[\t ]+.+$/ + column_pattern = /^#[\t ]+[\w\*`]+[\t ]+.+$/ old_columns = old_header && old_header.scan(column_pattern).sort new_columns = new_header && new_header.scan(column_pattern).sort @@ -235,7 +235,7 @@ def annotate_one_file(file_name, info_block, position, options={}) # Replace inline the old schema info with the new schema info new_content = old_content.sub(PATTERN, info_block + "\n") - if new_content.end_with? (info_block + "\n") + if new_content.end_with?(info_block + "\n") new_content = old_content.sub(PATTERN, "\n" + info_block) end