Forum: Ruby on Rails why can't I save to a join table in a migration or rake task

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Stephen B. (Guest)
on 2007-05-11 03:48
(Received via mailing list)
I've tried to put this in a migration and in a rake task but nothing
gets created in the roles_users join table:

   User.find(:all).each {|u| u.roles << member_role;! }

It works fine from script/console.
- Stephen B.
   Concord Consortium,
This topic is locked and can not be replied to.