Hi,

I'd like to ask something. I have messages and I have countries. I do
searches of messages by country. So a country has_many messages and
message belongs_to country.

I have defined a country_id on the messages country.

Is there a quick way to find how many messages belong to a country
without going through the messages find? I thought of adding a counter
to the country table and increase/decrease when a message for that
country is handled. Is this the right approach?

Thanks.
-- 
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