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
activerecord-2.1.1 test/models/vertex.rb
activerecord-2.1.0 test/models/vertex.rb
activerecord-2.3.2 test/models/vertex.rb
activerecord_authorails-1.0.0 test/fixtures/vertex.rb
antfarm-0.3.0 rails/vendor/rails/activerecord/test/models/vertex.rb
antfarm-0.4.0 rails/vendor/rails/activerecord/test/models/vertex.rb
backlog-0.0.0 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.0.1 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.0.2 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.0.4 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.0.5 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.1.1 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.1.0 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.1.2 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.2.0 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.2.1 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.3.0 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.3.3 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.3.1 vendor/rails/activerecord/test/fixtures/vertex.rb
backlog-0.3.2 vendor/rails/activerecord/test/fixtures/vertex.rb