Displaying 1 result from an estimated 1 matches for "taxontoxincit".
2007 Oct 18
0
Getting the through items from a has_many :through :uniq relationship
...gt; :taxon_toxin_citations, :uniq=> TRUE
so all I have to do is ask for taxon.toxins
But to get the list of citations/data objects linking a specific taxon
with each toxin is a bit trickier. I currently have
toxin_citations_for_taxon = {}
taxon.toxins.each do |toxin|
taxon_toxin_citations =
TaxonToxinCitation.find_all_by_taxon_id_and_toxin_id(taxon, toxin)
toxin_citations_for_taxon[toxin] = []
taxon_toxin_citations.each do |taxon_toxin_citation|
toxin_citations_for_taxon[toxin] <<
taxon_toxin_citation.data_object
end
end
which isn''t very DRY, and means that I have to retur...