Importing data with migration for habtm

I have 2 tables: products and categories. They are both linked by a
habtm association. I have a fixture to import all the data in each table
but I dont know how to import the data in the categories_products table
since that table has no model, so I cant use that code:

f = Fixtures.new(Category.connection, # a database connection
                 "categories", # table name
                 Category, # model class
                 File.join(File.dirname(__FILE__), 

“dev_data/categories”))
f.insert_fixtures

How can I do this?

Humm… I am surely not the first person to do this! I have googled
around and couldnt find anything…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs