From 8267e94b18be4dd362bc6dac4400106f57fed6ca Mon Sep 17 00:00:00 2001 From: crespire Date: Sat, 5 Jul 2025 12:27:44 -0400 Subject: [PATCH] Seed now adds some events relative to now --- db/seeds.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/db/seeds.rb b/db/seeds.rb index d094239..ef5d066 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -9,6 +9,41 @@ # end # zone = 'Eastern Time (US & Canada)' +sponsors = [ + { + name: 'Switch', + logo: 'switch.png', + link: 'https://switchgrowth.com' + }, + { + name: 'Shopify', + logo: 'shopify.png', + link: 'https://shopify.com' + }, + { + name: 'Clio', + logo: 'clio.png', + link: 'https://clio.com' + } +] + +15.times do + sponsor = sponsors.sample + before_after = rand(10) > 5 + now = Time.now.utc + time = before_after ? now + rand(7).days : now - rand(7).days + Event.create( + name: SecureRandom.hex(8), + location: "Location #{SecureRandom.hex(8)}", + description: "Description #{SecureRandom.hex(8)}", + sponsor: sponsor[:name], + sponsor_logo: sponsor[:logo], + sponsor_link: sponsor[:link], + status: :published, + start_at: time + ) +end + events = [ { name: 'Inaugural Edition',