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 connect it to the event as follows:
@event.users << @user
Does it implicitly create a registration object for the user / event? I set the: goal_amount column in my registration transfer, and I would like to be able to set: goal_amount when creating the registration. I need to explicitly create a registration (i.e.: Registration.create(:user_id => @user.id, :event_id => @event.id, :goal_amount => params[:goal_amount])to make this happen?
source
share