diff --git a/db/seeds.rb b/db/seeds.rb index 4862a44214..e26550defb 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -53,8 +53,6 @@ def seed log "\nDone.\n\n" end - - private # ------------------------------------------------------------------------------------------------------- # Used for reporting record counts after completion: diff --git a/db/seeds/db_populator.rb b/db/seeds/db_populator.rb index 3d9c872edd..a5080cd4a7 100644 --- a/db/seeds/db_populator.rb +++ b/db/seeds/db_populator.rb @@ -30,7 +30,7 @@ def create_org(options) @casa_org_counter += 1 options.org_name ||= "CASA Organization ##{@casa_org_counter}" - casa_org = CasaOrg.find_or_create_by!(name: options.org_name) { |org| + CasaOrg.find_or_create_by!(name: options.org_name) { |org| org.name = options.org_name org.display_name = options.org_name org.address = Faker::Address.full_address @@ -41,7 +41,6 @@ def create_org(options) ] org.logo.attach(io: File.open(CasaOrg::CASA_DEFAULT_LOGO), filename: CasaOrg::CASA_DEFAULT_LOGO.basename.to_s) } - casa_org end # Create 2 judges for each casa_org. @@ -355,6 +354,7 @@ def create_learning_hours(casa_org) end private # ------------------------------------------------------------------------------------------------------- + def most_recent_past_court_date(casa_case_id) CourtDate.where( "date < ? AND casa_case_id = ?", @@ -463,5 +463,4 @@ def random_true_false @true_false_array ||= [true, false] @true_false_array.sample(random: rng) end - end