Reputation: 19948
Would is the generic name for a data structure where a node can have many parent and many children, the object itself would be self-referential...
The MySQL tables might look like this:
NodeTbl
id: integer
NodeJoinTbl
source_node_id: integer
target_node_id: integer
A Persistent Ruby Class might looks like this:
class Node < ActiveRecord::Base
has_and_belongs_to_many :nodes
end
Upvotes: 1
Views: 63