# Habtm: attribute on join table

**URL:** <https://www.ruby-forum.com/t/habtm-attribute-on-join-table/55903>\
**Category:** Rails\
**Created:** [March 24, 2006, 10:56pm UTC](https://www.ruby-forum.com/t/habtm-attribute-on-join-table/55903 "2006-03-24T22:56:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![justinskolnick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@justinskolnick](https://www.ruby-forum.com/u/justinskolnick)\
**Post date:** [March 24, 2006, 10:56pm UTC](https://www.ruby-forum.com/t/habtm-attribute-on-join-table/55903/1 "2006-03-24T22:56:23Z")

</div>

How do I retrieve the value of an attribute on my join table? For  
example:

table ‘people\_places’  
person\_id  
place\_id  
disposition

The first two use foreign keys and all that (I get that part). The value  
of ‘disposition’ is what I want.

---

<div class="post-metadata">

**Author:** ![justinskolnick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@justinskolnick](https://www.ruby-forum.com/u/justinskolnick)\
**Post date:** [March 24, 2006, 10:59pm UTC](https://www.ruby-forum.com/t/habtm-attribute-on-join-table/55903/2 "2006-03-24T22:59:19Z")

</div>

Shit. Nevermind. Got it.

---

<div class="post-metadata">

**Author:** ![justinskolnick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@justinskolnick](https://www.ruby-forum.com/u/justinskolnick)\
**Post date:** [April 9, 2006, 9:00pm UTC](https://www.ruby-forum.com/t/habtm-attribute-on-join-table/55903/3 "2006-04-09T21:00:20Z")

</div>

If you’re going to post here, for God’s sake tell us what your solution  
was.

---

<div class="post-metadata">

**Author:** ![justinskolnick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/b5a626/32.png) [@justinskolnick](https://www.ruby-forum.com/u/justinskolnick)\
**Post date:** [April 9, 2006, 9:49pm UTC](https://www.ruby-forum.com/t/habtm-attribute-on-join-table/55903/4 "2006-04-09T21:49:09Z")

</div>

Justin S. wrote:

> How do I retrieve the value of an attribute on my join table? For  
> example:
> 
> table ‘people\_places’  
> person\_id  
> place\_id  
> disposition
> 
> The first two use foreign keys and all that (I get that part). The value  
> of ‘disposition’ is what I want.

Note that rich associations (attributes in join tables) have recently  
been deprecated. If you want that functionality, you should use a full  
join model (has\_many :through).  
[http://dev.rubyonrails.org/changeset/4123](http://dev.rubyonrails.org/changeset/4123)

–  
Josh S.  
[http://blog.hasmanythrough.com](http://blog.hasmanythrough.com)
