Add seeds for don

This commit is contained in:
benji 2015-03-26 12:45:45 +01:00
parent e4e717084b
commit 4e651882e9
17 changed files with 79 additions and 20 deletions

View file

@ -79,10 +79,6 @@ class UsersController < ApplicationController
end end
def user_params def user_params
if params[:user] params.permit(:user).permit(:avatar)
params.require(:user).permit(:avatar)
else
{}
end
end end
end end

View file

@ -11,25 +11,88 @@ DEFAULT_PASSWORD = "password"
products = [ products = [
{ {
name: 'Fanta', name: "Twix",
price: 0.6, price: 0.4,
category: 'beverages', category: "food",
stock: 25, stock: 0,
avatar: File.new('public/seeds/products/fanta.jpg', 'r') avatar: File.new('public/seeds/products/1.jpg', 'r')
}, },
{ {
name: 'Club Mate', name: "M&M Peanuts",
price: 1.2, price: 0.6,
category: 'beverages', category: "food",
stock: 25, stock: 0,
avatar: File.new('public/seeds/products/club_mate.jpg', 'r') avatar: File.new('public/seeds/products/2.jpg', 'r')
}, },
{ {
name: 'Kinder Bueno', name: "Snickers",
price: 0.6, price: 0.4,
category: 'food', category: "food",
stock: 15, stock: 0,
avatar: File.new('public/seeds/products/bueno.jpg', 'r') avatar: File.new('public/seeds/products/3.jpg', 'r')
},
{
name: "Fanta",
price: 0.6,
category: "beverages",
stock: 0,
avatar: File.new('public/seeds/products/4.jpg', 'r')
},
{
name: "Ice Tea",
price: 0.7,
category: "beverages",
stock: 0,
avatar: File.new('public/seeds/products/5.jpg', 'r')
},
{
name: "Cola",
price: 0.6,
category: "beverages",
stock: 0,
avatar: File.new('public/seeds/products/6.jpg', 'r')
},
{
name: "Abrikozencake",
price: 0.4,
category: "food",
stock: 0,
avatar: File.new('public/seeds/products/7.jpg', 'r')
},
{
name: "Kinder Delice",
price: 0.4,
category: "food",
stock: 0,
avatar: File.new('public/seeds/products/8.jpg', 'r')
},
{
name: "Kinder Bueno",
price: 0.6,
category: "food",
stock: 0,
avatar: File.new('public/seeds/products/9.jpg', 'r')
},
{
name: "Arizona Ice Tea",
price: 1.0,
category: "beverages",
stock: 0,
avatar: File.new('public/seeds/products/10.png', 'r')
},
{
name: "Dinosauruskoeken",
price: 0.5,
category: "food",
stock: 0,
avatar: File.new('public/seeds/products/11.jpg', 'r')
},
{
name: "Chocolade - melk",
price: 0.7,
category: "food",
stock: 0,
avatar: File.new('public/seeds/products/12.jpg', 'r')
} }
] ]

BIN
public/seeds/products/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
public/seeds/products/2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
public/seeds/products/3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
public/seeds/products/4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
public/seeds/products/5.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
public/seeds/products/6.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
public/seeds/products/7.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

BIN
public/seeds/products/8.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
public/seeds/products/9.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB