compile_template?(template, file_name, local_assigns)
private
Check whether compilation is necessary. Compile if the inline template or file has not been
compiled yet. Or if local_assigns has a new key, which isn’t
supported by the compiled code yet. Or if the file has changed on disk and
checking file mods hasn’t been disabled.
Show source
def compile_template?(template, file_name, local_assigns)
method_key = file_name || template
render_symbol = @@method_names[method_key]
if @@compile_time[render_symbol] && supports_local_assigns?(render_symbol, local_assigns)
if file_name && !@@cache_template_loading
@@compile_time[render_symbol] < File.mtime(file_name)
end
else
true
end
end