Subclassing a model

Is it possible to define a subclass for a model, that defines additional data columns, which are stored in a separate table?

Is there any description, how to do this?

Is it possible to define a subclass for a model, that defines additional data columns, which are stored in a separate table?

What you are describing is "Multiple Table Inheritance". I don't think stock rails handles this. Rails supports "Single Table Inheritance"[1] in which you'll store the union of all column types in the base table.

[1] ActiveRecord::Base

Is there any description, how to do this?

For STI make a table for the base class and subclass arbitrarily.

David J. Hamilton wrote:

You can certainly subclass a model.

Then the subclass could have a :has_one relationship to another model with the extra columns which the superclass doesn't have.

If you want to make it transparent, you can delegate the calls for the extra tables in the associated model, so instead of:    foo.bar.extra_value you can call:    foo.extra_value

Oh thanks. It seems, I not see wood for trees...