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.
Merge pull request rubyforgood#6062 from felicia22/main
refactor create_org
- Loading branch information
Showing
2 changed files
with
116 additions
and
107 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,12 +31,21 @@ 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 | ||
|
@@ -113,6 +122,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