aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorCharles Treatman <charles.treatman@gmail.com>2015-04-02 11:45:40 -0400
committerCharles Treatman <charles.treatman@gmail.com>2015-10-16 19:28:38 -0400
commitfa65b44b28b7c3de3b18b3431a7e76a6bef7f495 (patch)
treee2d3e1353f2b5eaf1893940b28649199ff3226b0 /railties
parent4d8f62dcfa0a5157b3facbd71f75fc6639636347 (diff)
downloadrails-fa65b44b28b7c3de3b18b3431a7e76a6bef7f495.tar.gz
rails-fa65b44b28b7c3de3b18b3431a7e76a6bef7f495.tar.bz2
rails-fa65b44b28b7c3de3b18b3431a7e76a6bef7f495.zip
Fix #21977: Removes memoization of helpers in Rails console
In the Rails console, the `helper` function provides a shorthand for working with application helpers. However, `helper` memoizes the value of `ApplicationController#helpers`. This means that if a user subsequently changes helper code and calls `reload!` in the console, their code changes will not be reflected by the `helper` function, even though the helper was, in fact, reloaded.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/console/helpers.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails/console/helpers.rb b/railties/lib/rails/console/helpers.rb
index b775f1ff8d..a33f71dc5b 100644
--- a/railties/lib/rails/console/helpers.rb
+++ b/railties/lib/rails/console/helpers.rb
@@ -4,7 +4,7 @@ module Rails
#
# This method assumes an +ApplicationController+ exists, and it extends +ActionController::Base+
def helper
- @helper ||= ApplicationController.helpers
+ ApplicationController.helpers
end
# Gets a new instance of a controller object.