-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathseeds.rb
19 lines (19 loc) · 2.14 KB
/
seeds.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
mapbox = Layer.create!("name"=>"MapBox Street", "url"=>"http://{s}.tiles.mapbox.com/v3/examples.map-vyofok3q/{z}/{x}/{y}.png", "attribution"=>"Tiles by MapBox")
Layer.create!("name"=>"Mapnik", "url"=>"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", "attribution"=>"Tiles by OpenStreetMap")
Layer.create!("name"=>"Mapnik-fr", "url"=>"http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", "attribution"=>"Tiles by OpenStreetMap-France")
Layer.create!("name"=>"Mapnik B&W", "url"=>"http://{s}.www.toolserver.org/tiles/bw-mapnik/{z}/{x}/{y}.png", "attribution"=>"Tiles by Wikimedia")
Layer.create!("name"=>"MapQuest", "url"=>"http://otile2.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png", "attribution"=>"Tiles by MapQuest")
Layer.create!("name"=>"Stamen B&W", "url"=>"http://{s}.tile.stamen.com/toner/{z}/{x}/{y}.png", "attribution"=>"Tiles by Stamen Design")
customer = Customer.create!("max_vehicles"=>3)
admin = User.create!("email"=>"admin@admin.com", "password"=>"123456789", "admin"=>true)
fred = User.create!("email"=>"user@user.com", "password"=>"123456789", "layer"=>mapbox, "customer"=>customer)
toto = User.create!("email"=>"toto@toto.com", "password"=>"123456789")
Vehicle.create!("capacity"=>100, "customer"=>customer, "name"=>"Renault Kangoo")
Vehicle.create!("capacity"=>100, "customer"=>customer, "name"=>"Fiat Vito")
Destination.create!("name"=>"l1", "street"=>"Place Picard", "postalcode"=>"33000", "city"=>"Bordeaux", "lat"=>44.84512, "lng"=>-0.578, "quantity"=>1, "customer"=>customer)
Destination.create!("name"=>"l2", "street"=>"Rue Esprit des Lois", "postalcode"=>"33000", "city"=>"Bordeaux", "lat"=>44.83395, "lng"=>-0.56545, "quantity"=>1, "customer"=>customer)
Destination.create!("name"=>"l3", "street"=>"Rue de Nuits", "postalcode"=>"33000", "city"=>"Bordeaux", "lat"=>44.84272, "lng"=>-0.55013, "quantity"=>1, "customer"=>customer)
Destination.create!("name"=>"l4", "street"=>"Rue de New York", "postalcode"=>"33000", "city"=>"Bordeaux", "lat"=>44.86576, "lng"=>-0.57577, "quantity"=>1, "customer"=>customer)
Tag.create!("label"=>"lundi", "customer"=>customer)
Tag.create!("label"=>"jeudi", "customer"=>customer)
Tag.create!("label"=>"frigo", "customer"=>customer)