On Jun 1, 10:48 am, Fernando Perez <[email protected]>
wrote:
> Hmm, actually I just watched the railscasts about the counter_cache, and
> in his log he also has this redundant SELECT that he didn't even spot.
>
> So I guess this could be an additional feature added to Rails to save 1
> DB query.

This is basically rails not knowing about inverse associations (which
it will do in the next version).
If you do do itself you should use increment_counter rather that doing
what you show above (which has a race condition).

Fred

> --
> Posted viahttp://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