Calculate cache_key only once

pull/6827/head
Tim Felgentreff 14 years ago
parent 9a560b19d9
commit 83ad9014ab
  1. 2
      lib/widget/base.rb

@ -43,7 +43,7 @@ class Widget::Base < Widget
end
def cache_key
"#{self.class.name.demodulize}/#{subject.cache_key}/#{@options}"
@cache_key ||= "#{self.class.name.demodulize}/#{subject.cache_key}/#{@options.sort_by(&:to_s)}"
end
def cached?

Loading…
Cancel
Save