Directed Acyclic graph implementation in Ruby on Rails
You should take a look at the through: option of has_many:

class Node
  has_many :parent_edges, class_name: "Edge", foreign_key: :child_id
  has_many :parents, through: :parent_edges

  # ditto for children
end


Getting at edge_properties depends on the version of Rails you are using.