16
특정 모델이 제공되면 관련 모델을 모두 반환합니다. 예 :모델의 관계를 어떻게 찾을 수 있습니까?
class Dog < ActiveRecord::Base
has_many :bones
belongs_to :master
end
d = Dog.first
d.associations #<== should return [Bone, Master]
내 자신을 굴릴 필요없이 이미 이것을 할 수있는 방법이 있습니까? 실패하면 가장 좋은 방법은 무엇입니까?