Skip to content

Commit

Permalink
Create seed data for placements and placement_types model
Browse files Browse the repository at this point in the history
  • Loading branch information
freestylebit committed Jun 1, 2024
1 parent 504af69 commit 7d9ef3f
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 7d9ef3f

Please sign in to comment.