From fa65b44b28b7c3de3b18b3431a7e76a6bef7f495 Mon Sep 17 00:00:00 2001
From: Charles Treatman <charles.treatman@gmail.com>
Date: Thu, 2 Apr 2015 11:45:40 -0400
Subject: 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.
---
 railties/lib/rails/console/helpers.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'railties')

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.
-- 
cgit v1.2.3