fixed dump rake task for plots

This commit is contained in:
Bastian Greshake
2016-02-23 17:42:57 +01:00
parent 71f5fd541c
commit 90b3e200dc

View File

@@ -12,21 +12,21 @@ namespace :numbers do
# now let's get the genotypes
File.open("#{Rails.root}/public/data/plot_data/number_genotypes.csv","w"){ |file|
Genotype.find_each do |u|
Genotype.find_each.with_index do |u,i|
file.write("#{i + 1}\t#{u.created_at}\n")
end
}
# what else do we need? oh yes, phenotypes
File.open("#{Rails.root}/public/data/plot_data/number_phenotypes.csv","w"){ |file|
Phenotype.find_each do |u|
Phenotype.find_each.with_index do |u,i|
file.write("#{i + 1}\t#{u.created_at}\n")
end
}
# and lastly the user phenotypes
File.open("#{Rails.root}/public/data/number_user_phenotypes.csv","w"){ |file|
UserPhenotype.find_each do |u|
File.open("#{Rails.root}/public/data/plot_data/number_user_phenotypes.csv","w"){ |file|
UserPhenotype.find_each.with_index do |u,i|
file.write("#{i + 1}\t#{u.created_at}\n")
end
}