diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2015-02-05 17:47:36 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2015-02-05 17:54:23 +0000 |
commit | 80838d9bd548d2b15f6692e84cbe30c697e54b4a (patch) | |
tree | 16b30c36df0e2c6fe8fd114b849561eff429f804 /railties/lib/rails | |
parent | da9038eaa5d19c77c734a044c6b35d7bfac01104 (diff) | |
download | rails-80838d9bd548d2b15f6692e84cbe30c697e54b4a.tar.gz rails-80838d9bd548d2b15f6692e84cbe30c697e54b4a.tar.bz2 rails-80838d9bd548d2b15f6692e84cbe30c697e54b4a.zip |
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.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/generators/actions.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |