Skip to content

Commit

Permalink
fix rubocop linting error
Browse files Browse the repository at this point in the history
  • Loading branch information
JudahSan committed Oct 18, 2024
1 parent 9ba323d commit fcee9ff
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require 'faker'

# frozen_string_literal: true
Expand All @@ -11,11 +13,11 @@

## User Seeds for local dev testing and setup.

LOCATIONS = ["Nairobi", "Mombasa", # Kenya
"Kampala", "Entebbe", # Uganda
"Dar es Salaam", "Arusha", # Tanzania
"Bujumbura", "Gitega", # Burundi
"Kigali", "Butare"] # Rwanda
LOCATIONS = ['Nairobi', 'Mombasa', # Kenya
'Kampala', 'Entebbe', # Uganda
'Dar es Salaam', 'Arusha', # Tanzania
'Bujumbura', 'Gitega', # Burundi
'Kigali', 'Butare'].freeze # Rwanda

def build_user
user = User.new
Expand All @@ -34,28 +36,23 @@ def build_user
def build_country
country = Country.new

country.name = %w(Kenya Uganda Tanzania Rwanda Burundi).sample
country.name = %w[Kenya Uganda Tanzania Rwanda Burundi].sample

country.save if country.valid?
end


def build_chapter
chapter = Chapter.new

chapter.name = ["#{Faker::Name.middle_name}", "Chapter"].join(" ")
chapter.name = [Faker::Name.middle_name.to_s, 'Chapter'].join(' ')
chapter.country = Country.all.sample
chapter.location = LOCATIONS.sample
chapter.description = "The East African chapter in #{chapter.location}"

chapter.save if chapter.valid?
end

users = []
countries = []
chpaters = []

10.times do
10.times do
build_user
end

Expand All @@ -65,4 +62,4 @@ def build_chapter

10.times do
build_chapter
end
end

0 comments on commit fcee9ff

Please sign in to comment.