Displaying 1 result from an estimated 1 matches for "abstractgenericth".
2006 Jul 02
7
Generic SingleTable inheritance
...order
to get critical feedback.
ActiveRecord supports single table inheritance(STI) "per se", BUT you
must add all possible instance variables(properties) of all subclasses
to the "base table"(as columns). I would like to circumvent this
restriction.
Say we have a
class AbstractGenericThing < ActiveRecord:Base
has_many :properties
end
In order to support STI the abstract_generic_things-table must have a
:type column.
Next comes the Property class
class Property < ActiveRecord:Base
belongs_to :GenericObject
end
The properties table has the following columns
:...