Hi there!
I have the following classes, but I don't undersant why, when I try to create some
class Wishlist < ActiveRecord::Base has_many :activated_user_wishlists, :class_name => "UserWishlist", :conditions => {:registered => true} has_many :users_registered, :through => :activated_user_wishlists, :class_name => "User", :source => "wishlist" end
class UserWishlist < ActiveRecord::Base belongs_to :wishlist belongs_to :user end
class User < ActiveRecord::Base has_many :user_wishlists has_many :wishlists, :through => :user_wishlists end
And when I try to do that: Wishlist.first.users_registered << User.first And then look at the join table, that's what I see:
#<UserWishlist user_id: nil, wishlist_id: 1, admin: false, registered:
]
Someone know why user_id is nil?