Skip to content

Commit

Permalink
fixed typo and optimized seed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kieran-Dunch committed Feb 24, 2022
1 parent 3250fda commit ca13904
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/views/offers/my_offers.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="container text-white">
<% if @offers.empty? %>
<h1 class="text-warning">You haven't created any offer yet!</h1>
<h1 class="text-warning">You haven't created any offers yet!</h1>
<%= link_to "Add an offer!", new_offer_path, class: "btn btn-light pt-2" %>
<%= link_to "HOME", root_path, class:"btn btn-light pt-2" %>
<% else %>
Expand Down
8 changes: 4 additions & 4 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
puts "Creating users"
# Create users
25.times do
user_name = Faker::Movies::StarWars.character
user_name = Faker::Movies::StarWars.unique.character
email_username = user_name.downcase.gsub(/\s+/, ".")
user = User.new(
username: user_name,
email: "#{email_username}#{rand(1..100)}@test.com",
email: "#{email_username}@test.com",
password: "123456",
side: ['evil', 'good', 'neutral'].sample
)
Expand All @@ -31,8 +31,8 @@
file = URI.open(user["image"])
rand_user = User.all.sample
offer = Offer.new(
title: "#{[Faker::Movies::StarWars.specie, Faker::Movies::StarWars.vehicle, Faker::Movies::StarWars.droid].sample} for #{["sale", "hire", "rent"].sample}",
price: rand(1..1000),
title: "#{[Faker::Movies::StarWars.specie, Faker::Movies::StarWars.vehicle, Faker::Movies::StarWars.droid].sample} #{['available', 'for hire', 'for rent'].sample}",
price: rand(1..100_00),
# location: Faker::Movies::StarWars.planet,
description: "#{Faker::Movies::StarWars.quote}. #{Faker::Movies::StarWars.quote}. #{Faker::Movies::StarWars.quote}",
address: Faker::Address.building_number
Expand Down
Binary file added san_francisco.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ca13904

Please sign in to comment.