Permalink
Browse files

Makes rails destroy scaffold don't duplicate routes.draw do |map| |ma…

…p| when using the deprecated syntax

[#5263 state:committed]
  • Loading branch information...
1 parent c544fcc commit e6331b1e97d608c46aaadd1814a1e370bdcdd40a @spastorino spastorino committed Aug 1, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 railties/lib/rails/generators/actions.rb
@@ -275,7 +275,7 @@ def freeze!(args={})
#
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 }

0 comments on commit e6331b1

Please sign in to comment.