Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Recipe < ActiveRecord::Base
- has_friendly_id :title, :use_slug => true
- belongs_to :origin
- has_many :recipe_ingredients
- has_many :ingredients, :through => :recipe_ingredients
- end
- class Ingredient < ActiveRecord::Base
- has_friendly_id :name, :use_slug => true
- has_many :recipe_ingredients
- has_many :recipes, :through => :recipe_ingredients
- end
- class RecipeIngredient < ActiveRecord::Base
- belongs_to :recipe
- belongs_to :ingredient
- end
Add Comment
Please, Sign In to add comment