I have two models:
USERS
has_many :celebrations
has_many :boards, :through => :celebrations
BOARDS
has_many :celebrations
has_many :users, :through => :celebrations
CELEBRATIONS
:belongs_to :user
:belongs_to :board
I understand that I create a third join table and model called "Celebrations" which does not require an ID.
create_table :, :id => false do |t|
t.column :board_id, :int, :null => false
t.column :user_id, :int, :null => false
t.column :role, :string, :null => false
t.column :token, :string
t.timestamps
end
end
How do I access the information?
user.celebrations.role user.celeberations.token
user.boards board.users
Thanks in advance. I understand its a real newbie question.