Sha256: 8fea7e7343fae906a66d2fe5d2113954c7d4e4e4092d0f5e647dc94790c64410

Contents?: true

Size: 377 Bytes

Versions: 7

Compression:

Stored size: 377 Bytes

Contents

# frozen_string_literal: true

# This class models a vertex in a directed graph.
class Vertex < ActiveRecord::Base
  has_many :sink_edges, class_name: "Edge", foreign_key: "source_id"
  has_many :sinks, through: :sink_edges

  has_and_belongs_to_many :sources,
    class_name: "Vertex", join_table: "edges",
    foreign_key: "sink_id", association_foreign_key: "source_id"
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
ibm_db-5.5.1 test/models/vertex.rb
ibm_db-5.5.0 test/models/vertex.rb
ibm_db-5.4.1 test/models/vertex.rb
ibm_db-5.4.0 test/models/vertex.rb
ibm_db-5.3.2 test/models/vertex.rb
ibm_db-5.3.1 test/models/vertex.rb
ruby-on-quails-0.1.0 activerecord/test/models/vertex.rb