rails/rails — pull request #7573 by keithgabryelski (2012-09-08 14:53:32+00:00)
Title: Partitioned

Aaron,

You asked for a pull request with the changes to make activerecord dynamically determine a model's table name such that it can support database table partitioning.

At the time, I was pretty incompetent with git and github -- I've adjusted and hope I'm doing this first pull request correctly.

Here is a branch of the partitioning code which has been modified to work with this pull request.

https://github.com/fiksu/partitioned/tree/rails-3-2-8-patching

I've created a repo with examples of different types of partitioning.

https://github.com/keithgabryelski/partitioned_examples

examples are in app/models and can be run like this:

$ cd partitioned_examples
$ rails runner app/models/company_id.rb --force