app/models/taxon_user_classification_filter.rb
# NOTE - these are only *browsable* hierarchies!
these are only *browsable* hierarchies!
these are only * browsable * hierarchies!
def hierarchy_entries
    return @hierarchy_entries if @hierarchy_entries
    TaxonConcept.preload_associations(taxon_concept, { published_hierarchy_entries: :hierarchy })
    @hierarchy_entries = taxon_concept.published_browsable_hierarchy_entries
    @hierarchy_entries = [_hierarchy_entry] if _hierarchy_entry && @hierarchy_entries.empty?
    HierarchyEntry.preload_associations(
      @hierarchy_entries,
      [ { agents_hierarchy_entries: :agent }, :rank, { hierarchy: :agent } ],
      select: {hierarchy_entries: [:id, :parent_id, :taxon_concept_id]}
    )
    @hierarchy_entries
  end
def hierarchy_entries return @hierarchy_entries if @hierarchy_entries TaxonConcept . preload_associations ( taxon_concept , { published_hierarchy_entries : :hierarchy } ) @hierarchy_entries = taxon_concept . published_browsable_hierarchy_entries @hierarchy_entries = [ _hierarchy_entry ] if _hierarchy_entry && @hierarchy_entries . empty? HierarchyEntry . preload_associations ( @hierarchy_entries , [ { agents_hierarchy_entries : :agent } , :rank , { hierarchy : :agent } ] , select : { hierarchy_entries : [ :id , :parent_id , :taxon_concept_id ] } ) @hierarchy_entries end
NOTE - these are only *browsable* hierarchies!
NOTE - these are only * browsable * hierarchies!