Oh sorry! I was copying the code out of a project I had.

change s.items.count to u.items.count


-- Bryce Roney

On 19/12/2008, at 12:13 PM, Scott Kulik wrote:

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