# Creating has\_and\_belongs\_to\_many from legacy data

**URL:** <https://www.ruby-forum.com/t/creating-has-and-belongs-to-many-from-legacy-data/144069>\
**Category:** Rails\
**Created:** [July 25, 2008, 4:06am UTC](https://www.ruby-forum.com/t/creating-has-and-belongs-to-many-from-legacy-data/144069 "2008-07-25T04:06:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jay](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@jay](https://www.ruby-forum.com/u/jay)\
**Post date:** [July 25, 2008, 4:06am UTC](https://www.ruby-forum.com/t/creating-has-and-belongs-to-many-from-legacy-data/144069/1 "2008-07-25T04:06:37Z")

</div>

I’ve just started using rails and I have a legacy DB with 2 models  
that have a habtm relationship. I know how to specify the  
association, but how do I create the associations from my legacy data?

Thanks,  
Jay
