That does help, thanks. Sometimes I need fresh data within an action 
even. Or for my tests--should the sql querries be cached during tests? 
Is the semantics for what is cached when documented anywhere?

I also discovered "ModelName.uncached do", which is helpful. But 
@individual_model.reload is good too, along with 
@individual_model.reset--although I'm not sure #reset will actually 
prevent re-use of the sql cache upon reload.

Some documentation of all this stuff would be really helpful, if anyone 
who understands it for sure wants to write some.

Jeff Cohen wrote:
> 
> Actually, that's only true during a single action (request-response
> cycle). Once your action is over, the cache is cleared.
> 
> You should always be getting new data.  If you need to get fresh data
> within an action,
> you can reload the model.
> 
> @order.reload
> 
> or
> 
> @order.products(true)  # reloads associated products collection
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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