请参阅以下关联:
class Continent < ActiveRecord::Base
has_many :countrys
class Country < ActiveRecord::Base
belongs_to :continent
has_many :addresses
class Address < ActiveRecord::Base
belongs_to :person
belongs_to :street
class Person < ActiveRecord::Base
has_many :addresses
Run Code Online (Sandbox Code Playgroud)
Person.includes()在查询数据库时,如何从一直到非洲大陆开始并包含关联.
我已经能够通过国家进入.includes(addresses: :country),但似乎没有达到最后一级.