# Legacy join table with extra attributes and Rails 2.0 (please ignore previous post with this subjec

**URL:** <https://www.ruby-forum.com/t/legacy-join-table-with-extra-attributes-and-rails-2-0-please-ignore-previous-post-with-this-subjec/145940>\
**Category:** Rails\
**Created:** [August 15, 2008, 10:34am UTC](https://www.ruby-forum.com/t/legacy-join-table-with-extra-attributes-and-rails-2-0-please-ignore-previous-post-with-this-subjec/145940 "2008-08-15T10:34:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RoRdeveloper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@RoRdeveloper](https://www.ruby-forum.com/u/RoRdeveloper)\
**Post date:** [August 15, 2008, 10:34am UTC](https://www.ruby-forum.com/t/legacy-join-table-with-extra-attributes-and-rails-2-0-please-ignore-previous-post-with-this-subjec/145940/1 "2008-08-15T10:34:50Z")

</div>

I am a fresh RoR developer and I am facing difficulty in getting a  
legacy join table (with extra attributes) to work with Rails 2.0. I  
wanted to apologize for the repeat post ( i accidentally pressed the  
wrong keys previously)

My rails application works well with Rails 1.2.3. Following is the set-  
up:

class Article  
has\_and\_belongs\_to\_many :users  
end

class User  
has\_and\_belongs\_to\_many :articles  
end

Legacy join table “articles\_users” has the exepcted columns: (1)  
article\_id (2) user\_id, and an extra third column say, (3) more\_info

Following are my observations:

(1) In my application, I use “push\_with\_attributes” method to save  
records to the legacy join table. My understanding is that support for  
“push\_with\_attributes” in particular, and extra attrbutes in habtm  
join tables, in general, is not present in Rails 2.0

(2) I tried to modify my application using the Rails recommended  
approach of using “has\_many :through” associations to realize join  
table with extra attributes. However, in this case Rails 2.0 appears  
to complain that the join table does not have a primary id column.

Is there a way to resolve this issue in Rails 2.0 framework without  
having to change the database table? Please let me know if I am  
missing something obvious.

---

<div class="post-metadata">

**Author:** ![RoRdeveloper](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@RoRdeveloper](https://www.ruby-forum.com/u/RoRdeveloper)\
**Post date:** [August 15, 2008, 1:41pm UTC](https://www.ruby-forum.com/t/legacy-join-table-with-extra-attributes-and-rails-2-0-please-ignore-previous-post-with-this-subjec/145940/2 "2008-08-15T13:41:55Z")

</div>

Well i believe using habtm you couldn’t access that more\_info column  
anyway. There’s not other way except modifying table and adding  
primary key.
