This project is archived and is in readonly mode.

#846 ✓resolved
Brian Johnson

write_fragment should return content when caching is disabled

Reported by Brian Johnson | August 16th, 2008 @ 05:48 PM | in 2.x

     def write_fragment(key, content, options = nil)
         return unless cache_configured?

         key = fragment_cache_key(key)

         self.class.benchmark "Cached fragment miss: #{key}" do
           cache_store.write(key, content, options)


line 2 should be return content unless cache_configured? Otherwise something like this render :json => write_fragment(key, some json data) will receive a nil value for render and look for an action.json.erb file instead of returning the non-cached value of content

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

Referenced by