Sha256: 099f9b267285f0241804952ebce9762905a159f1be2b9957bc81162c59ed310e

Contents?: true

Size: 388 Bytes

Versions: 4

Compression:

Stored size: 388 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

4 entries across 4 versions & 1 rubygems

Version Path
ibm_db-5.5.0-x86-mingw32 test/models/vertex.rb
ibm_db-5.4.1-x86-mingw32 test/models/vertex.rb
ibm_db-5.4.0-x86-mingw32 test/models/vertex.rb
ibm_db-5.3.2-x86-mingw32 test/models/vertex.rb