add image_id to product

Signed-off-by: Zeljko <zeljko@zwr.fi>
count products as you seed them

Signed-off-by: Zeljko <zeljko@zwr.fi>
Seed database inside transaction

Just making this take a somewhat more reasonable amount of time. It's
just a part of ACID: The database won't tell you it's done with an
INSERT until it actually has it on permanent storage... unless you did
it inside a transaction, in which case it's allowed to cache until
COMMIT and thus can batch writes. I didn't actually test whether the
outcome is the same because it took too long without the
transaction...

Signed-off-by: Ari Rahikkala <ari.rahikkala@gmail.com>
Further optimize database seeding

This could probably be brought down further, but it's just the seeding,
so there's no point. Mostly I just wanted to exercise my ActiveRecord.

Note that this does change the code's meaning, but I'm not sure the
original meaning was correct: find_car_brand returned a collection (due
to using m.car_brands.where rather than #find_by) if the brand already
existed. Now we return a scalar in either case.

Signed-off-by: Ari Rahikkala <ari.rahikkala@gmail.com>
layout: smaller image, push to right

Signed-off-by: Zeljko <zeljko@zwr.fi>