I’m running Rails on top of a Mongrel cluster. I have several model
classes that are going to have so many records it is not feasible to
keep them all in the same table. So I’ve split out the records into
many different tables, each with its own suffix which corresponds to
the id of the model to which all records in that particular table
For example, if I have a Domain AR object with an id of 20, all
DomainURL objects that :belong_to that particular Domain object are
stored in table domain_urls_20.
This necessitates a call to set_table_name before the DomainURL
objects are fetched, like so:
DomainURL.set_table_name “domain_urls_” + domain.id
However, when I go into production mode, I get mismatched table and
column names on my find’s. I am assuming this is caused by
ActiveRecord caching the domain model so that set_table_name is
rendered ineffective when it goes to fetch a record. However, I’m not
quite sure if this is the case.
If anyone could shed some light here, or possibly suggest an
alternative method of accomplishing my objective, I’m all ears.
Michael J. I. Jackson