So I’m playing around with models right now, and according to the Agile
Web D. with Rails book, this should express a many to many
class Request < ActiveRecord::Base
class User < ActiveRecord::Base
I’ve also created a table called requests_users with columns “user_id”
however, when I do this:
request1.users << user
request2.users << user
I get the error “Mysql::Error: Duplicate entry ‘191’ for key 1.”
What’s going on here? Shouldn’t a user be able to be associated with
more than one request?
Thanks in advance.