이 post에 설명 된대로 belongs_to :x, through: :y
관계는 대리인 메서드를 사용하는 것이 가장 좋습니다.레일즈에 belongs_to through 메소드가없는 이유는 무엇입니까?
레일즈가 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