이고 Recipe
, Ingredient
및 RecipeIngredient
입니다. 내 RecipeIngredient
has_many에서 조인 테이블의 추가 속성은
class Recipe
has_many :recipe_ingredients
has_many :ingredients, through: :recipe_ingredients
end
내가하지 않는 이상적인 방법으로 그것에 대해 갈 것 방법 등 amount
, unit
, type
,
나는 이러한 추가 속성을 검색 할 recipe.ingredients
에서 원한다면 같은 추가 속성이 있습니다 실적을 저하시키는 N + 1 개의 검색어 또는 다른 검색어를 소개 하시겠습니까?