Created
November 17, 2015 18:40
-
-
Save nettofarah/98eee90773de577c3e55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Chef < ActiveRecord::Base | |
has_many :recipes | |
has_many :ingredients, through: :recipes | |
end | |
class Recipe < ActiveRecord::Base | |
has_many :recipes_ingredients | |
has_many :ingredients, through: :recipes_ingredients | |
end | |
class Ingredient < ActiveRecord::Base | |
end | |
class RecipesIngredient < ActiveRecord::Base | |
belongs_to :recipe | |
belongs_to :ingredient | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment