阅读背景:

使用build不会在has_many上创建连接模型:通过关联

来源:互联网 

My 2 models:

我的2个型号:

Class TeamHistory < ActiveRecord::Base
  has_many :player_to_team_histories
  has_many :players, through: :player_to_team_histories

  belongs_to :team
end

Class Player < ActiveRecord::Base
  has_many :player_to_team_histories
  has_many :team_histories, through: :player_to_team_histories
end
Class TeamHistory < Ac



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: