Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
find_all and cached
def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
cached(key, [name, prefix, partial], details, locals) do
find_templates(name, prefix, partial, details)
end
end
def cached(key, prefix, name, partial)
return yield unless key && caching?
@cached[key][prefix][name][partial] ||= yield
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment