Commit 6311d7c1 by Robert Wahler

position_in_ should accept a string as well as a symbol

parent 0f2eec58
...@@ -142,7 +142,8 @@ module AnnotateModels ...@@ -142,7 +142,8 @@ 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 ? position = options[:position] || :before
new_content = position.to_sym == :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