p{border:1px solid green;padding: 0.5em;}. WikiGardening required This feature has been available as of ActiveRecord 1.0.0 (Rail 0.8) This article should be replaced with an explanation of how to use the @inheritance_column@ method.

Adds a class variable holding the name of the column to be used for single table inheritance (previously it was fixed at 'type'). "diff":http://www.redterror.net/ruby/activerecord-base.2.patch

_Review:_  You may prefer to use the method <code>single_table_inheritance_column_name</code> rather than directly accessing <code>@@single_table_inheritance_column_name</code>.  Also: replacing <code>self.type</code> with <code>self.single_table_inheritance_column_name</code> in <code>ensure_proper_type</code> is a bug. Use the <code>write_attribute</code> method instead.

Also, we need a bunch of unit tests to verify this new behavior -- DavidHeinemeierHansson

_Update:_ Thanks for the feedback, here is another patch which uses a method instead of the class variable and includes some tests.  It is also updated to be against 0.9.4.  You may like to organize the tests slightly differently, this was just simplest way I had.  "diff":http://www.redterror.net/ruby/activerecord.patch -- DaveSteinberg

The patch still seems to be a bit rough around the edges. The default tests aren't even using the companies_alt_inheritance fixtures and the table_name and inheritance_column_name methods on Companies are not class methods (and hence not used). In addition, it's pretty verbose in including a lot of duplicated code for the tests. I still like the idea, but the patch needs more work, which I don't have time for myself right now -- DavidHeinemeierHansson

Ok, I think I've got all these errors corrected: "diff += 2":http://www.redterror.net/ruby/ar-0.9.5-inheritance.diff ... that's against 0.9.5 but it requires my "public bracket methods" patch, posted separately on the PatchForum. -- DaveSteinberg
