Skip to content

Commit 361635e

Browse files
Updated seeds
1 parent 39a034c commit 361635e

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

db/seeds.rb

+31-19
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,46 @@
77
# movies = Movie.create([{ name: "Star Wars" }, { name: "Lord of the Rings" }])
88
# Character.create(name: "Luke", movie: movies.first)
99

10-
user_1 = User.create(name: 'User 1', email: '[email protected]', password: '1234567', password_confirmation: '1234567')
11-
user_2 = User.create(name: 'User 2', email: '[email protected]', password: '1234567', password_confirmation: '1234567')
10+
user_1 = User.create(name: 'Hailey Castro', email: '[email protected]', password: '1234567', password_confirmation: '1234567')
11+
user_2 = User.create(name: 'Ross Campbell', email: '[email protected]', password: '1234567', password_confirmation: '1234567')
12+
user_3 = User.create(name: 'Tristan Banks', email: '[email protected]', password: '1234567', password_confirmation: '1234567')
13+
user_4 = User.create(name: 'Tracey Thompson', email: '[email protected]', password: '1234567', password_confirmation: '1234567')
1214

1315
# Recipe Seeds
14-
recipe_1 = Recipe.create(name: 'Recipe 1', preparation_time: 45, cooking_time: 30, description: 'This is a description', public: true, user: user_1)
15-
recipe_2 = Recipe.create(name: 'Recipe 2', preparation_time: 85, cooking_time: 60, description: 'This is a description', public: true, user: user_1)
16-
recipe_3 = Recipe.create(name: 'Recipe 3', preparation_time: 15, cooking_time: 10, description: 'This is a description', public: true, user: user_1)
17-
recipe_4 = Recipe.create(name: 'Recipe 4', preparation_time: 95, cooking_time: 65, description: 'This is a description', public: true, user: user_2)
18-
recipe_5 = Recipe.create(name: 'Recipe 5', preparation_time: 75, cooking_time: 60, description: 'This is a description', public: true, user: user_2)
19-
recipe_6 = Recipe.create(name: 'Recipe 6', preparation_time: 60, cooking_time: 35, description: 'This is a description', public: true, user: user_1)
16+
recipe_1 = Recipe.create(name: 'Artichokes', preparation_time: 5, cooking_time: 20, description: 'Simple and delicious steamed artichokes. Serve these with melted butter for dipping. You will need a pan with a steamer insert.', public: false, user: user_1)
17+
recipe_2 = Recipe.create(name: 'Avocado Deviled Eggs', preparation_time: 20, cooking_time: 20, description: 'This is a twist on the traditional deviled egg. I usually use 1 or 2 fewer yolks for the filling.', public: true, user: user_1)
18+
recipe_3 = Recipe.create(name: 'Slammin Salmon', preparation_time: 136, cooking_time: 8, description: 'An amazing culinary delight. Hands down the greatest grilled salmon ever. Easy and delicious.', public: true, user: user_3)
19+
recipe_4 = Recipe.create(name: 'Stuffed Peppers', preparation_time: 30, cooking_time: 65, description: 'Roasted green bell peppers are stuffed with feta cheese and a mixture of rice and green onions.', public: true, user: user_2)
20+
recipe_5 = Recipe.create(name: 'Quick Halushki', preparation_time: 75, cooking_time: 60, description: 'Polish dish combining bacon, fried cabbage and egg noodles.', public: false, user: user_2)
21+
recipe_6 = Recipe.create(name: 'Hasenpfeffer', preparation_time: 40, cooking_time: 90, description: 'Rabbit stew made with bacon, wine, garlic, shallots, other herbs and spices.', public: true, user: user_1)
2022

2123

2224
# Inventories
23-
Inventory.create(name: 'Inventory 1', user_id: 1)
24-
Inventory.create(name: 'Inventory 2', user_id: 1)
25-
Inventory.create(name: 'Inventory 3', user_id: 1)
25+
inventory_1 = Inventory.create(name: 'Store', user_id: 1)
26+
inventory_2 = Inventory.create(name: 'Kitchen', user_id: 1)
27+
inventory_3 = Inventory.create(name: 'Store', user_id: 2)
28+
inventory_4 = Inventory.create(name: 'Kitchen', user_id: 2)
2629

2730
# Foods
28-
food_1 = Food.create(name: 'Apple', measurement_unit: 'grams', price: '5', user: user_1)
29-
food_2 = Food.create(name: 'Pineapple', measurement_unit: 'grams', price: '1', user: user_1)
31+
food_1 = Food.create(name: 'Apple', measurement_unit: 'Kg', price: '5', user: user_1)
32+
food_2 = Food.create(name: 'Pineapple', measurement_unit: 'Kg', price: '4', user: user_1)
3033
food_3 = Food.create(name: 'Chicken breasts', measurement_unit: 'units', price: '2', user: user_1)
34+
food_4 = Food.create(name: 'Garlic', measurement_unit: 'grams', price: '0.1', user: user_2)
35+
food_5 = Food.create(name: 'Red Wine', measurement_unit: 'liter', price: '4', user: user_2)
36+
food_6 = Food.create(name: 'Bacon', measurement_unit: 'grams', price: '0.5', user: user_1)
3137

3238
# RecipeFoods
33-
recipe_food_1 = RecipeFood.create(quantity: 3, recipe: recipe_1, food: food_1 )
34-
recipe_food_1 = RecipeFood.create(quantity: 6, recipe: recipe_1, food: food_2 )
35-
recipe_food_1 = RecipeFood.create(quantity: 1, recipe: recipe_1, food: food_3 )
39+
RecipeFood.create(quantity: 1, recipe: recipe_1, food: food_1 )
40+
RecipeFood.create(quantity: 50, recipe: recipe_1, food: food_4 )
41+
RecipeFood.create(quantity: 5, recipe: recipe_1, food: food_3 )
42+
RecipeFood.create(quantity: 1, recipe: recipe_2, food: food_1 )
43+
RecipeFood.create(quantity: 50, recipe: recipe_2, food: food_4 )
44+
RecipeFood.create(quantity: 5, recipe: recipe_2, food: food_3 )
3645

3746
# InventoryFoods
38-
InventoryFood.create(quantity: 2, inventory_id: 1, food_id: 1)
39-
InventoryFood.create(quantity: 2, inventory_id: 1, food_id: 2)
40-
InventoryFood.create(quantity: 2, inventory_id: 1, food_id: 3)
47+
InventoryFood.create(quantity: 5, inventory: inventory_1, food: food_1)
48+
InventoryFood.create(quantity: 2, inventory: inventory_1, food: food_2)
49+
InventoryFood.create(quantity: 10, inventory: inventory_1, food: food_3)
50+
InventoryFood.create(quantity: 5, inventory: inventory_2, food: food_4)
51+
InventoryFood.create(quantity: 2, inventory: inventory_2, food: food_5)
52+
InventoryFood.create(quantity: 10, inventory: inventory_3, food: food_6)

0 commit comments

Comments
 (0)