0
세 가지 모델이 있습니다. 그들은 아래와 같습니다.레일에서 여러 테이블을 쿼리하는 방법은 무엇입니까?
class User < ApplicationRecord
has_one :shop
has_one :address
end
class Shop < ApplicationRecord
belongs_to :user
end
class Address < ApplicationRecord
belongs_to :user
end
주소 모델에는 state_id 열이 있습니다. 지금은 가게의 주인 address.state_id
가 123456