Sha256: 0c4011ace3c3199dcdf9005223b20270df296609a6fd3241f52b7ee9ea6ed02c

Contents?: true

Size: 1.06 KB

Versions: 11

Compression:

Stored size: 1.06 KB

Contents

require 'active_record'
require 'rflow/configuration/uuid_keyed'

class RFlow
  class Configuration
    class Port < ConfigurationItem
      include UUIDKeyed
      include ActiveModel::Validations

      belongs_to :component,  :primary_key => 'uuid', :foreign_key => 'component_uuid'

      # TODO: Make some sort of component/port validation work here
      #validate :component_has_defined_port
    end

    # STI-based classes
    class InputPort < Port
      has_many :input_connections, :class_name => 'RFlow::Configuration::Connection', :primary_key => 'uuid', :foreign_key => 'input_port_uuid'
      has_many :connections, :class_name => 'RFlow::Configuration::Connection', :primary_key => 'uuid', :foreign_key => 'input_port_uuid'
    end

    class OutputPort < Port
      has_many :output_connections, :class_name => 'RFlow::Configuration::Connection', :primary_key => 'uuid', :foreign_key => 'output_port_uuid'
      has_many :connections, :class_name => 'RFlow::Configuration::Connection', :primary_key => 'uuid', :foreign_key => 'output_port_uuid'
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rflow-1.3.0 lib/rflow/configuration/port.rb
rflow-1.3.0a1 lib/rflow/configuration/port.rb
rflow-1.2.0 lib/rflow/configuration/port.rb
rflow-1.1.0 lib/rflow/configuration/port.rb
rflow-1.0.1 lib/rflow/configuration/port.rb
rflow-1.0.0 lib/rflow/configuration/port.rb
rflow-1.0.0a6 lib/rflow/configuration/port.rb
rflow-1.0.0a5 lib/rflow/configuration/port.rb
rflow-1.0.0a4 lib/rflow/configuration/port.rb
rflow-1.0.0a3 lib/rflow/configuration/port.rb
rflow-1.0.0a2 lib/rflow/configuration/port.rb