From b68ffbce4b95f5cc329cb564f7e26f9e5ffd4b8a Mon Sep 17 00:00:00 2001 From: Alicia Date: Fri, 29 Mar 2024 12:19:14 -0600 Subject: [PATCH] Fix seeds --- db/seeds.rb | 4 ++-- lib/tasks/populate.rake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 01f654c57..9f6d66c75 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -50,8 +50,8 @@ main = false end # Create random location around cities in US - Rake::Task['populate:random_locations'].invoke + Rake::Task["populate:random_locations"].invoke # Create organizations and causes association - Rake::Task['populate:seed_organizations_causes'].invoke + Rake::Task["populate:seed_organizations_causes"].invoke end diff --git a/lib/tasks/populate.rake b/lib/tasks/populate.rake index 57972fb9a..42a3e4909 100644 --- a/lib/tasks/populate.rake +++ b/lib/tasks/populate.rake @@ -21,7 +21,7 @@ namespace :populate do desc "Seed organizations and causes association" task seed_organizations_causes: :environment do - Organization.all.each do |organization| + Organization.all.find_each do |organization| OrganizationCause.create!(organization: organization, cause: Cause.all.sample) organization.update!(active: true) end