Class: Tasks::CollectionObjects::Stepwise::DeterminationsController

Inherits:
ApplicationController
  • Object
show all
Includes:
TaskControllerConfiguration
Defined in:
app/controllers/tasks/collection_objects/stepwise/determinations_controller.rb

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#dataObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/tasks/collection_objects/stepwise/determinations_controller.rb', line 8

def data
  s = ::Queries::CollectionObject::Filter.new(taxon_determinations: :false)
    .all

  @collection_objects = ::CollectionObject.select('buffered_determinations, count(buffered_determinations) count_buffered').where('buffered_determinations is not null')
    .where(id: s.all)
    .group('buffered_determinations')
    .having('count(buffered_determinations) > ?', params[:count_cutoff] || 10)
    .order('count(buffered_determinations) DESC')
    .page(params[:page])
    .per(params[:per])

  render json: @collection_objects
end

#indexObject



5
6
# File 'app/controllers/tasks/collection_objects/stepwise/determinations_controller.rb', line 5

def index
end