aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails_generator/commands.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails_generator/commands.rb')
-rw-r--r--railties/lib/rails_generator/commands.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/railties/lib/rails_generator/commands.rb b/railties/lib/rails_generator/commands.rb
index 8db14302da..783d9aeb3a 100644
--- a/railties/lib/rails_generator/commands.rb
+++ b/railties/lib/rails_generator/commands.rb
@@ -342,8 +342,10 @@ module Rails
sentinel = 'ActionController::Routing::Routes.draw do |map|'
logger.route "map.resources #{resource_list}"
- gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
- "#{match}\n map.resources #{resource_list}\n"
+ unless options[:pretend]
+ gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
+ "#{match}\n map.resources #{resource_list}\n"
+ end
end
end