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

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.
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; u.save! }

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