mirror of
https://github.com/chenasraf/snpr.git
synced 2026-05-18 01:39:01 +00:00
* Breaks up Zipfulldata worker into service classes * Fixes N+1 queries for phenotype and picture phenotype CSVs * moving phenotype CSV generation into database for performance * Fixes unintentional deletion of unrelated files * Reduces the time it takes to assemble the zip file from about 10 to about 5 hours, with the bottle-neck being zipping the genotype files
39 lines
421 B
Ruby
39 lines
421 B
Ruby
# frozen_string_literal: true
|
|
BODY_PARTS = %w{
|
|
hair
|
|
head
|
|
eyebrow
|
|
eyelash
|
|
eye
|
|
ear
|
|
nose
|
|
nostril
|
|
mouth
|
|
teeth
|
|
tongue
|
|
forearm
|
|
hand
|
|
finger
|
|
fingernail
|
|
thumb
|
|
torso
|
|
buttocks
|
|
leg
|
|
knee
|
|
heal
|
|
foot
|
|
toe
|
|
toenail
|
|
}.freeze
|
|
|
|
PROPERTIES = %w{
|
|
length
|
|
width
|
|
color
|
|
size
|
|
}.freeze
|
|
|
|
100.times do
|
|
Phenotype.find_or_create_by(characteristic: "#{BODY_PARTS.sample} #{PROPERTIES.sample}")
|
|
end
|