-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug with seeding data exports to database due to hardcoded year…
…s for sample names (#881)
- Loading branch information
1 parent
08505f0
commit 4eeb234
Showing
1 changed file
with
10 additions
and
8 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 |
---|---|---|
|
@@ -204,38 +204,40 @@ def seed_workflow_executions # rubocop:disable Metrics/MethodLength, Metrics/Abc | |
end | ||
|
||
def seed_exports # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity | ||
current_year = Time.zone.now.year | ||
|
||
export_params = [ | ||
{ | ||
user: User.find_by(email: '[email protected]'), | ||
sample: Sample.find_by(name: 'Bacillus anthracis/Outbreak 2022 Sample 10') | ||
sample: Sample.find_by(name: "Bacillus anthracis/Outbreak #{current_year - 2} Sample 10") | ||
}, | ||
{ | ||
user: User.find_by(email: '[email protected]'), | ||
sample: Sample.find_by(name: 'Bartonella henselae/Outbreak 2022 Sample 10') | ||
sample: Sample.find_by(name: "Bartonella henselae/Outbreak #{current_year - 2} Sample 10") | ||
}, | ||
{ | ||
user: User.find_by(email: '[email protected]'), | ||
sample: Sample.find_by(name: 'Bordetella pertussis/Outbreak 2022 Sample 10') | ||
sample: Sample.find_by(name: "Bordetella pertussis/Outbreak #{current_year - 2} Sample 10") | ||
}, | ||
{ | ||
user: User.find_by(email: '[email protected]'), | ||
sample: Sample.find_by(name: 'Borrelia burgdorferi/Outbreak 2022 Sample 10') | ||
sample: Sample.find_by(name: "Borrelia burgdorferi/Outbreak #{current_year - 2} Sample 10") | ||
}, | ||
{ | ||
user: User.find_by(email: '[email protected]'), | ||
sample: Sample.find_by(name: 'Brucella abortus/Outbreak 2022 Sample 10') | ||
sample: Sample.find_by(name: "Brucella abortus/Outbreak #{current_year - 2} Sample 10") | ||
}, | ||
{ | ||
user: User.find_by(email: '[email protected]'), | ||
sample: Sample.find_by(name: 'Campylobacter jejuni/Outbreak 2022 Sample 10') | ||
sample: Sample.find_by(name: "Campylobacter jejuni/Outbreak #{current_year - 2} Sample 10") | ||
}, | ||
{ | ||
user: User.find_by(email: '[email protected]'), | ||
sample: Sample.find_by(name: 'Yersinia pestis/Outbreak 2022 Sample 10') | ||
sample: Sample.find_by(name: "Yersinia pestis/Outbreak #{current_year - 2} Sample 10") | ||
}, | ||
{ | ||
user: User.find_by(email: '[email protected]'), | ||
sample: Sample.find_by(name: 'Vibrio cholerae/Outbreak 2023 Sample 10') | ||
sample: Sample.find_by(name: "Vibrio cholerae/Outbreak #{current_year - 1} Sample 10") | ||
} | ||
] | ||
export_params.each_with_index do |export_param, index| # rubocop:disable Metrics/BlockLength | ||
|