require 'snp_db_connection' class Strain < ActiveRecord::Base has_many :alleles, :through => :genotypes has_many :genotypes end class Feature < ActiveRecord::Base has_many :annotations has_many :snps end class Snp < ActiveRecord::Base belongs_to :feature has_many :alleles belongs_to :reference_allele, :class_name => "Allele", :foreign_key => "reference_allele_id" end class Allele < ActiveRecord::Base has_many :genotypes belongs_to :snp has_many :strains, :through => :genotypes end class Genotype < ActiveRecord::Base belongs_to :allele belongs_to :strain end class Annotation < ActiveRecord::Base belongs_to :feature end