# Activerecord-import for multiple tables

**URL:** <https://www.ruby-forum.com/t/activerecord-import-for-multiple-tables/187785>\
**Category:** Rails\
**Created:** [April 29, 2010, 7:36am UTC](https://www.ruby-forum.com/t/activerecord-import-for-multiple-tables/187785 "2010-04-29T07:36:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepak\_kannan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@deepak\_kannan](https://www.ruby-forum.com/u/deepak_kannan)\
**Post date:** [April 29, 2010, 7:36am UTC](https://www.ruby-forum.com/t/activerecord-import-for-multiple-tables/187785/1 "2010-04-29T07:36:33Z")

</div>

hi,  
i wanted to use ‘activerecord-import’ for bulk import but i have  
dependent  
tables.  
if i insert in one table then two more tables have to be inserted with  
the  
foreign key. can i use activerecord-import in this case.

the database structure would be like:  
a product table with a product\_details table having a one-to-one  
relationship  
and a product\_index table having some selected columns from product,  
product\_details table to make indexing and pagination faster.  
another table having a counter\_cache to make pagination easier.

so any inserts for products will be split into the product and  
product\_details table, with some selected information being inserted  
into  
product\_index table.

ccing: removed\_email\_address@domain.invalid

thanks,  
deepak
