Scott Kulik wrote:
> Sazima wrote:
>> Maybe s.items.count is zero?
>> 
>> Cheers, Sazima
>> 
>> On Dec 19, 5:01�am, Scott Kulik <rails-mailing-l...@andreas-s.net>
> 
> hmm...it shouldn't be since @user.items.count in my view shows the count 
> correctly for each user.

is there another i can do it like this but not using a migration?

i tried to create a rake task but that didn't work.  here is my rake 
task:

sku...@kuliksco-ub:/u1/app/wldev/lib/tasks$ cat update_items_count.rake
task :updateItemsCount do
  User.find(:all) do |u|
    u.update_attribute :items_count, s.items.count
  end
end

sku...@kuliksco-ub:/u1/app/wldev/lib/tasks$ rake updateItemsCount
(in /u1/app/wldev)
rake aborted!
uninitialized constant User

(See full trace by running task with --trace)

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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to