[Rails] Re: updating referenced table

2008-10-06 Thread Katsuo Isono
I got the result with the following: def update_status @books=Book.find(:all) for book in @books Record.update_all("status='read' where name='#{book.name}'") end end Many thanks FB -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You r

[Rails] Re: updating referenced table

2008-10-06 Thread Xie Hanjian
* Katsuo Isono <[EMAIL PROTECTED]> [2008-10-05 13:41:43 +0200]: > > I have the following two tables books and records > > fields for books table: id, name > fields for records table:id, name, status > > I would like to insert value 'read' to status field in records table > when name matches na