Skip to content

Commit

Permalink
Merge pull request #5804 from rubyforgood/pc-seed
Browse files Browse the repository at this point in the history
Create seed data for `placement_types` model
  • Loading branch information
compwron authored Jul 5, 2024
2 parents e5d68e7 + f2782c7 commit 5958031
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def active_record_classes
SupervisorVolunteer,
User,
LearningHour,
Volunteer
Volunteer,
PlacementType
]
end

Expand Down Expand Up @@ -121,3 +122,4 @@ def log(message)
rescue => e
puts "Caught error during db seed emancipation_options_prune, continuing. Message: #{e}"
end
load(Rails.root.join("db", "seeds", "placement_data.rb"))
16 changes: 16 additions & 0 deletions db/seeds/placement_data.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
casa_orgs = CasaOrg.all

placement_types = [
"Reunification",
"Custody/Guardianship by a relative",
"Custody/Guardianship by a non-relative",
"Adoption by relative",
"Adoption by a non-relative",
"APPLA"
]

casa_orgs.each do |org|
placement_types.each do |label|
PlacementType.where(name: label, casa_org: org).first_or_create
end
end

0 comments on commit 5958031

Please sign in to comment.