【发布时间】:2019-04-25 23:59:03
【问题描述】:
class Supplier < ApplicationRecord
has_one :account
has_one :account_history, through: :account
end
class Account < ApplicationRecord
belongs_to :supplier
has_one :account_history
end
class AccountHistory < ApplicationRecord
belongs_to :account
end
由于某种原因,rails 6 无法在 Supplier 和 AccountHistory 之间创建连接!
如果我们已经存在Supplier 和存在AccountHistory,需要示例如何创建此连接
【问题讨论】:
标签: ruby-on-rails ruby associations