Class: Services::AvailableFilesController

Inherits:
ConfiguredAccountBaseController show all
Includes:
StatusMasking
Defined in:
app/controllers/services/available_files_controller.rb

Constant Summary

Constants included from StatusMasking

StatusMasking::NEGATE_MASK, StatusMasking::STATUS_MASK

Constants inherited from ApplicationController

Services::ApplicationController::MAX_LIST_LENGTH

Instance Attribute Summary

Attributes inherited from ConfiguredAccountBaseController

#configured_account

Attributes inherited from ServiceDefinitionBaseController

#parent, #service_definition

Instance Method Summary collapse

Methods included from StatusMasking

#determine_status_operator

Instance Method Details

#indexObject



8
9
10
11
12
13
14
15
# File 'app/controllers/services/available_files_controller.rb', line 8

def index
  status, operator = determine_status_operator(params[:status])
  if status.present?
    @available_files = .available_files.where("status #{operator} ?", status).order("created_at DESC").limit(MAX_LIST_LENGTH)
  else
    @available_files = .available_files.order("created_at DESC").limit(MAX_LIST_LENGTH)
  end
end