Class: Tasks::BiologicalAssociations::FilterController

Inherits:
ApplicationController
  • Object
show all
Includes:
TaskControllerConfiguration
Defined in:
app/controllers/tasks/biological_associations/filter_controller.rb

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#download_indexObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/tasks/biological_associations/filter_controller.rb', line 4

def download_index
  biological_associations = ::Queries::BiologicalAssociation::Filter.new(params).all

  scope = ::BiologicalAssociationIndex.where(
    biological_association_id: biological_associations.select(:id)
  )

  send_data(
    Export::CSV.generate_csv(
      scope,
      exclude_columns: %w{id project_id created_by_id updated_by_id created_at updated_at rebuild_set
        biological_association_id biological_relationship_id subject_id object_id}
    ),
    type: 'text',
    filename: "biological_associations_index_#{DateTime.now}.tsv"
  )
end