aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/console
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2015-06-05 16:30:54 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2015-06-05 18:38:53 +0900
commit4fded7c069c4fc0ea0909ebc86a624bce25eb3f5 (patch)
tree300f00be83476ed8ef5d770d87a39cf4a6dc63cd /railties/lib/rails/console
parent6c4416183454cc75ee4dbed107fe7370c69fc37d (diff)
downloadrails-4fded7c069c4fc0ea0909ebc86a624bce25eb3f5.tar.gz
rails-4fded7c069c4fc0ea0909ebc86a624bce25eb3f5.tar.bz2
rails-4fded7c069c4fc0ea0909ebc86a624bce25eb3f5.zip
modify console of app method in that can use the path helpers
Diffstat (limited to 'railties/lib/rails/console')
-rw-r--r--railties/lib/rails/console/app.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/railties/lib/rails/console/app.rb b/railties/lib/rails/console/app.rb
index 2a69c26deb..ac5836a588 100644
--- a/railties/lib/rails/console/app.rb
+++ b/railties/lib/rails/console/app.rb
@@ -18,6 +18,11 @@ module Rails
app = Rails.application
session = ActionDispatch::Integration::Session.new(app)
yield session if block_given?
+
+ # This makes app.url_for and app.foo_path available in the console
+ session.extend(app.routes.url_helpers)
+ session.extend(app.routes.mounted_helpers)
+
session
end