Wednesday, 13 May 2009

Active Scaffold and Inheritance

Had a problem getting two cases of single table inheritance to work in ActiveScaffold so thought I'd document it. Package and Classifier are the ActiveRecord classes.

class ExpressSchema
has_many :express_entities, :foreign_key => 'package_id'
end

class ExpressEntity
belongs_to :express_schema, :class_name => 'ExpressSchema',
:foreign_key => 'package_id'
end

No comments:

Post a Comment