Class: Services::AssessmentRequestsController

Inherits:
ApplicationController show all
Includes:
StatusMasking
Defined in:
app/controllers/services/assessment_requests_controller.rb

Constant Summary

Constants included from StatusMasking

StatusMasking::NEGATE_MASK, StatusMasking::STATUS_MASK

Constants inherited from ApplicationController

Services::ApplicationController::MAX_LIST_LENGTH

Instance Method Summary collapse

Methods included from StatusMasking

#determine_status_operator

Instance Method Details

#createObject



18
19
20
21
22
23
24
# File 'app/controllers/services/assessment_requests_controller.rb', line 18

def create
  ca = ConfiguredAccount.find params[:configured_account_id]

  RequestSltcBaselineContext.call(ca, safe_params)

  render :index
end

#indexObject



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

def index
  where_clause = build_where_clause

  if where_clause.present?
    @assessment_requests = AssessmentRequest.where(where_clause).order("created_at DESC").limit(MAX_LIST_LENGTH)
  else
    @assessment_requests = AssessmentRequest.order("created_at DESC").limit(MAX_LIST_LENGTH)
  end
end