Class: Tasks::CollectingEvents::Stepwise::CollectorsController

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

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#dataObject

GET



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

def data
  s = ::Queries::CollectingEvent::Filter.new(collectors: :false)
                                        .all

  @collecting_events = ::CollectingEvent.select('verbatim_collectors, count(verbatim_collectors) count_collectors').where('verbatim_collectors is not null')
                                         .where(id: s.all)
                                         .group('verbatim_collectors')
                                         .having('count(verbatim_collectors) > ?', params[:count_cutoff] || 10)
                                         .order('count(verbatim_collectors) DESC')
                                         .page(params[:page])
                                         .per(params[:per])

  render json: @collecting_events
end

#indexObject



5
6
# File 'app/controllers/tasks/collecting_events/stepwise/collectors_controller.rb', line 5

def index
end