aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/renderable.rb7
-rw-r--r--actionpack/lib/action_view/template_handlers/compilable.rb12
2 files changed, 2 insertions, 17 deletions
diff --git a/actionpack/lib/action_view/renderable.rb b/actionpack/lib/action_view/renderable.rb
index ebb0f1b674..ffcffd1667 100644
--- a/actionpack/lib/action_view/renderable.rb
+++ b/actionpack/lib/action_view/renderable.rb
@@ -69,11 +69,8 @@ module ActionView
# The template will be compiled if the file has not been compiled yet, or
# if local_assigns has a new key, which isn't supported by the compiled code yet.
def recompile?(symbol)
- unless Base::CompiledTemplates.instance_methods.include?(symbol) && Base.cache_template_loading
- true
- else
- false
- end
+ meth = Base::CompiledTemplates.instance_method(template.method) rescue nil
+ !(meth && Base.cache_template_loading)
end
end
end
diff --git a/actionpack/lib/action_view/template_handlers/compilable.rb b/actionpack/lib/action_view/template_handlers/compilable.rb
index 7e45761481..a0ebaefeef 100644
--- a/actionpack/lib/action_view/template_handlers/compilable.rb
+++ b/actionpack/lib/action_view/template_handlers/compilable.rb
@@ -15,18 +15,6 @@ module ActionView
def render(template, local_assigns = {})
@view.send(:execute, template, local_assigns)
end
-
- private
- # Method to check whether template compilation is necessary.
- # The template will be compiled if the inline template or file has not been compiled yet,
- # if local_assigns has a new key, which isn't supported by the compiled code yet.
- def recompile_template?(template)
- # Unless the template has been compiled yet, compile
- # If template caching is disabled, compile
- # Always recompile inline templates
- meth = Base::CompiledTemplates.instance_method(template.method) rescue nil
- !meth || !Base.cache_template_loading || template.is_a?(InlineTemplate)
- end
end
end
end