lib/onebox/layout.rb in onebox-1.9.20 vs lib/onebox/layout.rb in onebox-1.9.21

- old
+ new

@@ -6,16 +6,14 @@ class Layout < Mustache include TemplateSupport VERSION = "1.0.0" - attr_reader :cache attr_reader :record attr_reader :view - def initialize(name, record, cache) - @cache = cache + def initialize(name, record) @record = Onebox::Helpers.symbolize_keys(record) # Fix any relative paths if @record[:image] && @record[:image] =~ /^\/[^\/]/ @record[:image] = "#{uri.scheme}://#{uri.host}/#{@record[:image]}" @@ -26,12 +24,10 @@ @template_name = "_layout" @template_path = load_paths.last end def to_html - result = cache.fetch(checksum) { render(details) } - cache[checksum] = result if cache.respond_to?(:key?) - result + render(details) end private def uri