Adding elementos into a collection

So I have this

Event
has_many :assistance
has_many :users, :through => :assistance

User
has_many :assistance
has_many :assisted_events, :through => :assistance, :source =>
:assistance

Assistance
belongs_to :user
belongs_to :event

Users assisting to events are assigned using

@event.users << user
BUT assistance model also have an status attribute, so I need to fill it
at the same time of doing @event.users << user, is it possible to make
it on the same line? I actually dont know how to assign that attribute

On Tue, Aug 9, 2011 at 1:56 PM, Tomas R. [email protected] wrote:

Users assisting to events are assigned using

@event.users << user
BUT assistance model also have an status attribute, so I need to fill it
at the same time of doing @event.users << user, is it possible to make
it on the same line? I actually dont know how to assign that attribute

Look for “Association callbacks”


Hassan S. ------------------------ [email protected]

twitter: @hassan