Sha256: 747e3feda5fcd0e6db779dff0ba3121cd0c92947725525cd6c8a706f97eb9afb

Contents?: true

Size: 376 Bytes

Versions: 8

Compression:

Stored size: 376 Bytes

Contents

# 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

8 entries across 8 versions & 1 rubygems

Version Path
ibm_db-5.2.0-x86-mingw32 test/models/vertex.rb
ibm_db-5.1.0-x86-mingw32 test/models/vertex.rb
ibm_db-5.0.5-x86-mingw32 test/models/vertex.rb
ibm_db-5.0.4-x86-mingw32 test/models/vertex.rb
ibm_db-5.0.3-x86-mingw32 test/models/vertex.rb
ibm_db-5.0.2-x86-mingw32 test/models/vertex.rb
ibm_db-3.0.5-x86-mingw32 test/models/vertex.rb
ibm_db-3.0.5 test/models/vertex.rb