On Wed, Mar 9, 2011 at 11:08 PM, Ar Chron <[email protected]> wrote:

> Ack... obfuscated logic.  If you are trying to not make the call when
> the cache fragment already exists, then don't do so.
>
> @varieties = Variety.all unless fragment_exist?( 'select_box' )
>
> Don't squirrel it away behind a scope which does nothing except let you
> defer the decision about executing the DB read and depend on a behavior
> of AR which is determined when the view is being rendered...

+1

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to