# How can I set attribute of join model in a has many through association?

**URL:** <https://www.ruby-forum.com/t/how-can-i-set-attribute-of-join-model-in-a-has-many-through-association/202152>\
**Category:** Rails\
**Created:** [January 23, 2011, 11:39am UTC](https://www.ruby-forum.com/t/how-can-i-set-attribute-of-join-model-in-a-has-many-through-association/202152 "2011-01-23T11:39:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [January 23, 2011, 11:39am UTC](https://www.ruby-forum.com/t/how-can-i-set-attribute-of-join-model-in-a-has-many-through-association/202152/1 "2011-01-23T11:39:27Z")

</div>

I have:

class Ruser \< ActiveRecord::Base  
has\_many :deliveries  
has\_many :bags, :through =\> :deliveries

class Bag \< ActiveRecord::Base  
has\_many :deliveries  
has\_many :rusers, :through =\> :deliveries

class Delivery \< ActiveRecord::Base  
belongs\_to :ruser  
belongs\_to :bag

Delivery has an extra attribute :delivered\_at of type date.

I have Ruser and Bag already populated.  
I want to assign bags to rusers simultaneously setting delivered\_at.  
Doing user.bags \<\< bags doesn’t allow to set delivered\_at.
