SpeciesFileGroup/taxonworks

View on GitHub
app/controllers/tasks/collection_objects/classification_summary_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Tasks::CollectionObjects::ClassificationSummaryController < ApplicationController
  include TaskControllerConfiguration

  # GET
  def index
  end

  def report
    @ancestor = TaxonName.where(project_id: sessions_current_project_id).where(id: params[:taxon_name_id]).first
    @ancestor ||= sessions_current_project.root_taxon_name
    @data = ::Queries::TaxonName::Filter.new(
      taxon_name_id: @ancestor.id,
      descendants: true,
      rank: params[:rank])
      .all.order(:cached)
    @rank = params[:rank]
  end

end