Class: Tasks::DataAttributes::FieldSynchronizeController

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

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#valuesObject



6
7
8
9
10
11
12
13
14
# File 'app/controllers/tasks/data_attributes/field_synchronize_controller.rb', line 6

def values
  if q = Queries::Query::Filter.instantiated_base_filter(params)
    if !q.params.empty?
      @records = q.all.select(:id, *params[:attribute]).order(params[:attribute]).page(params[:page]).per(params[:per])
      render json: @records.to_json and return
    end
  end
  render json: {}, status: :unprocessable_entity
end