Class: ActiveRecord::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/bio-ensembl/db_connection.rb

Class Method Summary collapse

Class Method Details

.belongs_to_whatObject



16
17
18
# File 'lib/bio-ensembl/db_connection.rb', line 16

def self.belongs_to_what
  return self.reflect_on_all_associations(:belongs_to).collect{|a| a.name.to_s}
end

.has_whatObject



20
21
22
23
# File 'lib/bio-ensembl/db_connection.rb', line 20

def self.has_what
  a = [self.reflect_on_all_associations(:has_one), self.reflect_on_all_associations(:has_many)]
  return a.flatten.uniq.collect{|a| a.name.to_s}
end