diff options
author | Xavier Noria <fxn@hashref.com> | 2010-04-03 10:56:15 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-04-03 10:56:15 -0700 |
commit | 11161e6c96fb6686a33e05ead106b96089ff9790 (patch) | |
tree | 35d5618f1a866ce8ba11efd8e6851d2fd7bbf5fc /actionpack/lib/action_view/template.rb | |
parent | 4996d1a445acd965d0064500ad00d692a742f669 (diff) | |
parent | 467d251c3dcbd3e4dd1e785a21d63535b795a64c (diff) | |
download | rails-11161e6c96fb6686a33e05ead106b96089ff9790.tar.gz rails-11161e6c96fb6686a33e05ead106b96089ff9790.tar.bz2 rails-11161e6c96fb6686a33e05ead106b96089ff9790.zip |
Merge commit 'rails/master'
Diffstat (limited to 'actionpack/lib/action_view/template.rb')
-rw-r--r-- | actionpack/lib/action_view/template.rb | 9 |
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) |