提交 2d6562d5 编写于 作者: J Jeremy Kemper

Move dead recompile_template? also

上级 3fbefecc
......@@ -69,11 +69,8 @@ def #{render_symbol}(local_assigns)
# 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
......@@ -15,18 +15,6 @@ def compilable?
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册