为什么Rails没有belongs_to through方法?

mig*_*igu 1 activerecord ruby-on-rails

在本概述,一个belongs_to :x, through: :y关系最好的委托方法来实现的.

是否有一个特殊的原因(技术原因,设计选择)为什么Rails不通过关系支持belongs_to?

class Division
  belongs_to :league
  has_many :teams
end

class Team
  belongs_to :division
  has_many :players
end

class Player
  belongs_to :team
  belongs_to :division, through: :team # WON'T WORK
end
Run Code Online (Sandbox Code Playgroud)

Has*_*ass 5

它会像这样工作而不是通过.

belongs_to :division, class_name: Team
Run Code Online (Sandbox Code Playgroud)