I’m creating an app that will import products from several XML feeds. In
the XML there is a category specified, like T-Shirt for instance. The
problem is that different resellers specify the categories differently.
instance, what one reseller calls “T-Shirts” another may call “T-Shirt”,
third “short sleeved shirts” and so on.
I want to somehow map these categories to the categories I have myself.
I need some tips on how I should create my database.
The idea I have is to create a “raw_categories” table which contains the
name of the resellers category and a “category_id” which has a
relationship to my own “categories” table. Then when I import I simply
to find a raw_category which has a matching name and if there is one,
it, otherwise add a new one. This new one I can then manually relate to
of my own categories.
Do you understand how I mean, and is it a good approach? Is there a
better/more efficient way?
- If this is a good idea. How do I do it in Rails? Should I use
like this (I think I’ve seen something like this in the API doc):
has_one :category, :through => :raw_categories
I estimate that there will be about 40k to 100k products in the