Bryce Roney wrote:
> You can run a migration like this
> 
> def self.up
>    User.find(:all) do |u|
>      u.update_attribute :items_count, s.items.count
>    end
> end
> 
> 
> That will go through all your users and update the items_count field
> for all of them.
> ~~~~~~~~~~~~~~~
> Bryce Roney
> [ twitter ][ blog ][ myspace ][ facebook ]

thanks for the quick response!

i just ran it but it didn't seem to update anything.

just curious what is the 's' for in s.items.count?
-- 
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