The point of the _count field is to count the number of child objects
a specific parent has, so if you were adding a count column now, I''m
assuming you''d have to update that column with the correct numbers?
It''s just a normal field triggered by am after_filter in rails or
something no?
I''ve never used it, this is just my understanding of it.
John Kopanas wrote:> I want to add a _count to a couple of my models but this is not a new
> relationship so the numbers will not start at zero. I have tried just
> adding an update_attribute to my migration with the current count but for
> some reason the DB will not take the new number.
> Does the _count field have a protection on it so people can not tamper with
> it? What is the proper way to add a _count field to relationships that
> already exist in production i.e. is there a Rails way of doing it?
> --
> John Kopanas
> john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org
>
> Blog: http://www.kopanas.com
> Conference: http://www.cusec.net
> Twits: http://www.twitter.com/kopanas
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---