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
16 lines
383 B
Ruby
16 lines
383 B
Ruby
# frozen_string_literal: true
|
|
|
|
class UserSnp < ApplicationRecord
|
|
self.primary_keys = [:genotype_id, :snp_name]
|
|
belongs_to :snp, foreign_key: :snp_name, primary_key: :name, counter_cache: true
|
|
has_one :user, through: :genotype
|
|
belongs_to :genotype
|
|
|
|
validates_presence_of :snp
|
|
validates_presence_of :genotype
|
|
|
|
def local_genotype
|
|
self[:local_genotype].strip
|
|
end
|
|
end
|