Forum: Ruby on Rails update table with ActiveRecord

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Beada4200408a4bfa7750b4c84e518d4?d=identicon&s=25 Unnikrishnan Kp (unni123)
on 2008-12-10 22:06
(Received via mailing list)
How do i do an "update posts set `home`=1" with ActiveRecord?
Beada4200408a4bfa7750b4c84e518d4?d=identicon&s=25 Unnikrishnan Kp (unni123)
on 2008-12-10 22:09
(Received via mailing list)
sorry. a peek into the API gave me the solution.

Post.update_all(:home=>1)
This topic is locked and can not be replied to.