Reputation: 14630
Right now I have the following, which works fine:
e = Event.find(params[:based_on_id])
@event = e.clone
@event.tag_ids = e.tag_ids
@event.subcategories = e.subcategories
However I would like to avoid the last two lines, especially since my model may change its association structure in the future. I just want a pristine "new" copy, which includes all associations.
Note: the associations above are has_many :through.
Upvotes: 0
Views: 274