Permalink
Browse files

Move dead recompile_template? also

  • Loading branch information...
1 parent 3fbefec commit 2d6562d51b96af518c1eb2947d6d34d5dd5bad12 @jeremy jeremy committed Jul 14, 2008
@@ -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

0 comments on commit 2d6562d

Please sign in to comment.