lib/queries/source/filter.rb
# Return all citations on Taxon names and descendants,
# and optionally OTUs.
Return all citations on Taxon names and descendants,
and optionally OTUs.
Return all citations on Taxon names and descendants and optionally OTUs .
def ancestors_facet
        return nil if ancestor_id.nil?
        joins = [
          ancestor_taxon_names_join,
          ancestor_taxon_name_classifications_join,
          ancestor_taxon_name_relationship_join(:subject_taxon_name_id),
          ancestor_taxon_name_relationship_join(:object_taxon_name_id)
        ]
        joins.push ancestor_otus_join if citations_on_otus
        union = joins.collect{|j| '(' + ::Source.joins(:citations).joins( j.join_sources).to_sql + ')'}.join(' UNION ')
        ::Source.from("( #{union} ) as sources")
      end
def ancestors_facet return nil if ancestor_id . nil? joins = [ ancestor_taxon_names_join , ancestor_taxon_name_classifications_join , ancestor_taxon_name_relationship_join ( :subject_taxon_name_id ) , ancestor_taxon_name_relationship_join ( :object_taxon_name_id ) ] joins . push ancestor_otus_join if citations_on_otus union = joins . collect { | j | '(' + :: Source . joins ( :citations ) . joins ( j . join_sources ) . to_sql + ')' } . join ( ' UNION ' ) :: Source . from ( "( #{union} ) as sources" ) end
Return all citations on Taxon names and descendants,
and optionally OTUs.
Return all citations on Taxon names and descendants and optionally OTUs .