If I'm not completely wrong what you want is just STI:
class Message < ActiveRecord::Base
belongs_to :post
end
class Letter < Message
end
class Post < ActiveRecord::Base
has_many :messages
has_many :letters
end
For each inherited model of Message that you access by
Post.inherited_modelname(s) (like in Post.first.letters) you need a
has_many declaration in the Post class.
For each inherited model of Message that you access by
Post.inherited_modelname(s) (like in Post.first.letters) you need a
has_many declaration in the Post class.
Thanks. I thought has_many creates automatically the relation to the
subclasses.