From fcee9ff249f3c1d65cc80f9372a2d3481c4a835b Mon Sep 17 00:00:00 2001 From: judahsan Date: Fri, 18 Oct 2024 13:54:56 +0300 Subject: [PATCH] fix rubocop linting error --- db/seeds.rb | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index fae2e86a..949bd4d1 100755 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'faker' # frozen_string_literal: true @@ -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 @@ -34,16 +36,15 @@ 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}" @@ -51,11 +52,7 @@ def build_chapter chapter.save if chapter.valid? end -users = [] -countries = [] -chpaters = [] - -10.times do +10.times do build_user end @@ -65,4 +62,4 @@ def build_chapter 10.times do build_chapter -end \ No newline at end of file +end