forked from rubyforgood/casa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Felicia Yi
committed
Sep 28, 2024
1 parent
69d3b13
commit a4a388a
Showing
2 changed files
with
118 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,19 +31,30 @@ def seed | |
db_populator.create_all_casa_admin("[email protected]") | ||
db_populator.create_all_casa_admin("[email protected]") | ||
db_populator.create_all_casa_admin("[email protected]") | ||
db_populator.create_org(CasaOrgPopulatorPresets.for_environment.merge({org_name: "Prince George CASA"})) | ||
db_populator.create_org(CasaOrgPopulatorPresets.minimal_dataset_options) | ||
|
||
options1 = OpenStruct.new(CasaOrgPopulatorPresets.for_environment.merge({org_name: "Prince George CASA"})) | ||
org1 = db_populator.create_org(options1) | ||
create_org_related_data(db_populator, org1, options1) | ||
|
||
options2 = OpenStruct.new(CasaOrgPopulatorPresets.minimal_dataset_options) | ||
org2 = db_populator.create_org(options2) | ||
create_org_related_data(db_populator, org2, options2) | ||
|
||
SmsNotificationEventPopulator.populate | ||
2.times do | ||
DbPopulator.new(rng, case_fourteen_years_old: true) | ||
.create_org(CasaOrgPopulatorPresets.minimal_dataset_options) | ||
options3 = OpenStruct.new(CasaOrgPopulatorPresets.minimal_dataset_options) | ||
org3 = DbPopulator.new(rng, case_fourteen_years_old: true) | ||
.create_org(options3) | ||
create_org_related_data(db_populator, org3, options3) | ||
end | ||
|
||
post_process_data | ||
report_object_counts | ||
log "\nDone.\n\n" | ||
end | ||
|
||
|
||
|
||
private # ------------------------------------------------------------------------------------------------------- | ||
|
||
# Used for reporting record counts after completion: | ||
|
@@ -113,6 +124,20 @@ def log(message) | |
|
||
puts message | ||
end | ||
|
||
def create_org_related_data(db_populator, casa_org, options) | ||
db_populator.create_users(casa_org, options) | ||
db_populator.create_cases(casa_org, options) | ||
db_populator.create_hearing_types(casa_org) | ||
db_populator.create_checklist_items | ||
db_populator.create_judges(casa_org) | ||
db_populator.create_languages(casa_org) | ||
db_populator.create_mileage_rates(casa_org) | ||
db_populator.create_learning_hour_types(casa_org) | ||
db_populator.create_learning_hour_topics(casa_org) | ||
db_populator.create_learning_hours(casa_org) | ||
db_populator.create_other_duties | ||
end | ||
end | ||
|
||
SeederMain.new.seed | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters