scinote-web/app/models/connection.rb
2017-06-28 15:21:32 +02:00

12 lines
355 B
Ruby

class Connection < ApplicationRecord
belongs_to :to,
class_name: 'MyModule',
foreign_key: 'input_id',
inverse_of: :inputs,
optional: true
belongs_to :from,
class_name: 'MyModule',
foreign_key: 'output_id',
inverse_of: :outputs,
optional: true
end