From 80838d9bd548d2b15f6692e84cbe30c697e54b4a Mon Sep 17 00:00:00 2001 From: Andrew White Date: Thu, 5 Feb 2015 17:47:36 +0000 Subject: Force generated route to be inserted Thor isn't very discerning over whether some content is present when passed to `inject_into_file`, e.g. a commented out route is detected as being present. So to prevent people scratching their heads as to why a route hasn't appeared it's better to fall on the side of having duplicate routes. --- railties/lib/rails/generators/actions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index e39a45f4c9..c1bc646c65 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -221,7 +221,7 @@ module Rails sentinel = /\.routes\.draw do\s*\n/m in_root do - inject_into_file 'config/routes.rb', " #{routing_code}", { after: sentinel, verbose: false } + inject_into_file 'config/routes.rb', " #{routing_code}", { after: sentinel, verbose: false, force: true } end end -- cgit v1.2.3