Sha256: e72a04ec3f38bf712287c2685618145af39719cf096d116a3063522ebb6c3697

Contents?: true

Size: 367 Bytes

Versions: 220

Compression:

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

220 entries across 217 versions & 30 rubygems

Version Path
backlog-0.3.4 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.3.5 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.3.6 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.3.7 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.3.8 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.3.9 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.4.0 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.5.0 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.5.1 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.5.2 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.5.10 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.5.4 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.5.3 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.5.5 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.5.6 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.5.7 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.5.8 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.5.9 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.6.1 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.6.2 vendor/rails/activerecord/test/fixtures/vertex.rb