Makes rails destroy scaffold don't duplicate routes.draw do |map| |map| when using the deprecated syntax

[#5263 state:committed]
This commit is contained in:
Santiago Pastorino
2010-07-31 22:33:22 -03:00
parent c544fcc8eb
commit e6331b1e97

View File

@@ -275,7 +275,7 @@ module Rails
#
def route(routing_code)
log :route, routing_code
sentinel = /\.routes\.draw do(\s*\|map\|)?\s*$/
sentinel = /\.routes\.draw do(?:\s*\|map\|)?\s*$/
in_root do
inject_into_file 'config/routes.rb', "\n #{routing_code}\n", { :after => sentinel, :verbose => false }