Can't access field through 3 models in Rails 5
问题 I'm trying to do something very similar to this question I have 4 models, one of which (CoffeeBlend) is a join table: class CoffeeRoast < ApplicationRecord has_many :coffee_blends has_many :coffee_beans, through: :coffee_blends has_one :country, through: :coffee_beans end class CoffeeBean < ApplicationRecord has_many :coffee_blends has_many :coffee_roasts, through: :coffee_blends belongs_to :country end class Country < ApplicationRecord has_many :coffee_beans end class CoffeeBlend <