diff options
author | Charles Treatman <charles.treatman@gmail.com> | 2015-04-02 11:45:40 -0400 |
---|---|---|
committer | Charles Treatman <charles.treatman@gmail.com> | 2015-10-16 19:28:38 -0400 |
commit | fa65b44b28b7c3de3b18b3431a7e76a6bef7f495 (patch) | |
tree | e2d3e1353f2b5eaf1893940b28649199ff3226b0 /railties/lib/rails/console/helpers.rb | |
parent | 4d8f62dcfa0a5157b3facbd71f75fc6639636347 (diff) | |
download | rails-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/lib/rails/console/helpers.rb')
-rw-r--r-- | railties/lib/rails/console/helpers.rb | 2 |
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. |