Skip to content

Commit e6331b1

Browse files
committed
Makes rails destroy scaffold don't duplicate routes.draw do |map| |map| when using the deprecated syntax
[rails#5263 state:committed]
1 parent c544fcc commit e6331b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

railties/lib/rails/generators/actions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ def freeze!(args={})
275275
#
276276
def route(routing_code)
277277
log :route, routing_code
278-
sentinel = /\.routes\.draw do(\s*\|map\|)?\s*$/
278+
sentinel = /\.routes\.draw do(?:\s*\|map\|)?\s*$/
279279

280280
in_root do
281281
inject_into_file 'config/routes.rb', "\n #{routing_code}\n", { :after => sentinel, :verbose => false }

0 commit comments

Comments
 (0)