0
я следующие две модели:Как выглядит следующая модель Rails в Sequel?
class Dispute < ApplicationRecord
belongs_to :accuser, class_name: 'User', optional: true
belongs_to :defendant, class_name: 'User', optional: true
end
class User < ApplicationRecord
end
Вот миграция Dispute
:
class CreateDisputes < ActiveRecord::Migration[5.0]
def change
create_table :disputes do |t|
t.references :accuser
t.references :defendant
end
end
end
Это, как они ведут себя в Rails:
Dispute.first.accuser
# => <# User>
Dispute.first.defendant
# => <# User>
В Sequel, я м предположил to use many_to_one
, но означает ли это, что модель Sequel User
должна иметь соответствующий one_to_many
? Кажется, он не работает.