I would like to have a model with different types of has n
, for example:
class Blog
include DataMapper::Resource
property :id, Serial
has 1, :owner # of type user...
has n, :authors # of type user...
end
class User
include DataMapper::Resource
property :id, Serial
has n, :blogs # owns some number
has n, :blogs # is a member of some number
end
I don't, however, want to use the Discriminator
, since then I need to make new Owner or Author objects of old User objects and that would be ridiculous.
How can I best achieve this?