Commit c15ac1f8 by Robert Wahler

fix: position_in_class uses a symbol, per the rake file

parent cac265d8
...@@ -117,7 +117,7 @@ module AnnotateModels ...@@ -117,7 +117,7 @@ module AnnotateModels
# #
# === Options (opts) # === Options (opts)
# :position<Symbol>:: where to place the annotated section in fixture or model file, # :position<Symbol>:: where to place the annotated section in fixture or model file,
# "before" or "after". Default is "before". # :before or :after. Default is :before.
# :position_in_class<Symbol>:: where to place the annotated section in model file # :position_in_class<Symbol>:: where to place the annotated section in model file
# :position_in_fixture<Symbol>:: where to place the annotated section in fixture file # :position_in_fixture<Symbol>:: where to place the annotated section in fixture file
# :position_in_others<Symbol>:: where to place the annotated section in the rest of # :position_in_others<Symbol>:: where to place the annotated section in the rest of
...@@ -142,7 +142,7 @@ module AnnotateModels ...@@ -142,7 +142,7 @@ module AnnotateModels
new_content = old_content.sub(/^# #{COMPAT_PREFIX}.*?\n(#.*\n)*\n/, info_block) new_content = old_content.sub(/^# #{COMPAT_PREFIX}.*?\n(#.*\n)*\n/, info_block)
# But, if there *was* no old schema info, we simply need to insert it # But, if there *was* no old schema info, we simply need to insert it
if new_content == old_content if new_content == old_content
new_content = options[:position] == 'before' ? new_content = options[:position] == :before ?
(info_block + old_content) : (info_block + old_content) :
((old_content =~ /\n$/ ? old_content : old_content + '\n') + info_block) ((old_content =~ /\n$/ ? old_content : old_content + '\n') + info_block)
end end
......
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