Module: QA_Rails::ContentMarkdownCache
Instance Method Summary collapse
Instance Method Details
#_content_markdown_cache ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/qa-rails.rb', line 8 def _content_markdown_cache seconds = Rails.env == 'development' ? 1.second : 5.minutes key = "/json/#{self.class.table_name}/#{self.id}/_content_markdown_cache" Rails.cache.fetch(key, :expires_in => seconds) do c = MarkdownTopicConverter.format(self.content.to_s) puts self.content.inspect, " - "*8, c c end end |