diff --git a/db/seeds/01_alta.rb b/db/seeds/01_alta.rb index 5c80adcbb..6d40019c5 100644 --- a/db/seeds/01_alta.rb +++ b/db/seeds/01_alta.rb @@ -207,8 +207,12 @@ ) path = Rails.root.join("app", "assets", "images", "hero.jpg") + from_weight = [5, 10, 20, 30, 40, 50, 60].sample + 50.times do - from_weight = [5, 10, 20, 30, 40, 50, 60].sample + species = Pet.species.keys.sample + breed = "Faker::Creature::#{species.classify}".constantize.breed + pet = Pet.create!( name: Faker::Creature::Dog.name, birth_date: Faker::Date.birthday(min_age: 0, max_age: 3), @@ -216,10 +220,10 @@ weight_from: from_weight, weight_to: from_weight + 15, weight_unit: Pet::WEIGHT_UNITS.sample, - breed: Faker::Creature::Dog.breed, + breed: breed, description: "He just loves a run and a bum scratch at the end of the day", - species: Pet.species["Dog"], - placement_type: 0, + species: species, + placement_type: Pet.placement_types.values.sample, published: true ) pet.images.attach(io: File.open(path), filename: "hero.jpg") @@ -250,6 +254,7 @@ @fosterable_pets = Array.new(3) do from_weight = [5, 10, 20, 30, 40, 50, 60].sample + Pet.create!( name: Faker::Creature::Dog.name, birth_date: Faker::Date.birthday(min_age: 0, max_age: 3), diff --git a/db/seeds/02_baja.rb b/db/seeds/02_baja.rb index 842181aa4..03ceeb2c3 100644 --- a/db/seeds/02_baja.rb +++ b/db/seeds/02_baja.rb @@ -159,8 +159,12 @@ end path = Rails.root.join("app", "assets", "images", "hero.jpg") + from_weight = [5, 10, 20, 30, 40, 50, 60].sample + 25.times do - from_weight = [5, 10, 20, 30, 40, 50, 60].sample + species = Pet.species.keys.sample + breed = "Faker::Creature::#{species.classify}".constantize.breed + pet = Pet.create!( name: Faker::Creature::Dog.name, birth_date: Faker::Date.birthday(min_age: 0, max_age: 3), @@ -168,10 +172,10 @@ weight_from: from_weight, weight_to: from_weight + 15, weight_unit: Pet::WEIGHT_UNITS.sample, - breed: Faker::Creature::Dog.breed, + breed: breed, description: "He just loves a run and a bum scratch at the end of the day", - species: Pet.species["Dog"], - placement_type: 1, + species: species, + placement_type: Pet.placement_types.values.sample, published: true ) pet.images.attach(io: File.open(path), filename: "hero.jpg")