I have events and users/teams.
class Event
has_many :users, :through => :registrations
end
class User
has_many :events, :through => :registrations
end
class Registration
belongs_to :users
belongs_to :events
end
When I register a user, I'm connecting them to the event like so:
@event.users << @user
Does this implicitly create the Registration object for the user/event? I've put a :goal_amount column in my Registration migration, and I would like to be able to set the :goal_amount when the Registration is created. Do I need to explicitly create a Registration (ie: Registration.create(:user_id => @user.id, :event_id => @event.id, :goal_amount => params[:goal_amount])
to make this happen?