[edit] http://www.akitaonrails.com/2007/12/10/the-first-rails-2-0-screencast-english solved my problem. Apparently i had the t.references set up backwards

So, I have basically this:

model {User, Interest}:

has_and_belongs_to_many :{users, interests}

migration Create{Users, Interests}:

create_table :{users, interests} do |t|
____t.references :{interests, users}

end


migration SeedUsers:

User.create :interests_id =>

____Interest.find_all_by_interest_type("tech").each do

____|i| i.id

end

Which gives me:

id interests_id
1 __1

And it doesn’t look right. It seems like UserInterest should be somehow involved, but I can’t find any migration examples online…

Advertisements