#724 confirmed
smoofles

Self-referential Many to Many

Reported by smoofles | December 20th, 2008 @ 03:04 PM

If a model is described as:


class Topic
  include DataMapper::Resource 

  property :somestring,          String,    :length => 255
  property :topic_id,       Integer
  
  belongs_to :topic
  
  has n, :topics, :through => DataMapper::Resource
  
  is :list, :scope => [:topic_id]
  
end

The migration created a topics_topics table in the database that only has one row – topics_id

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Pages