aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/template.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2010-04-04 17:34:23 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2010-04-04 17:34:23 +0100
commit00884a59013a658082dab41da5ff41add31b8c43 (patch)
tree666b862b08b04c7a3727ee22b2cd1a2561af4e52 /actionpack/lib/action_view/template.rb
parent48b2451142355b22de5f8130b3debdd4e53e2ba2 (diff)
parent7d7e0627a0490b6b4ddb0ee5429264ccd46f1245 (diff)
downloadrails-00884a59013a658082dab41da5ff41add31b8c43.tar.gz
rails-00884a59013a658082dab41da5ff41add31b8c43.tar.bz2
rails-00884a59013a658082dab41da5ff41add31b8c43.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'actionpack/lib/action_view/template.rb')
-rw-r--r--actionpack/lib/action_view/template.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index 8abc1633ff..3df2bd8eed 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -18,6 +18,14 @@ module ActionView
attr_reader :source, :identifier, :handler, :virtual_path, :formats
+ def self.finalizer_for(method_name)
+ proc do
+ ActionView::CompiledTemplates.module_eval do
+ remove_possible_method method_name
+ end
+ end
+ end
+
def initialize(source, identifier, handler, details)
@source = source
@identifier = identifier
@@ -98,6 +106,7 @@ module ActionView
begin
ActionView::CompiledTemplates.module_eval(source, identifier, line)
+ ObjectSpace.define_finalizer(self, self.class.finalizer_for(method_name))
method_name
rescue Exception => e # errors from template code
if logger = (view && view.logger)