Class: Search::CreditApplicationTextPresenter

Inherits:
CreditApplicationPresenter
  • Object
show all
Defined in:
app/presenters/search/credit_application_text_presenter.rb

Overview

Plain-text variant of CreditApplicationPresenter for CSV/Excel exports.

Instance Method Summary collapse

Instance Method Details

#credit_applicationString?

Credit-application reference number (no link).

Returns:

  • (String, nil)


18
19
20
21
22
# File 'app/presenters/search/credit_application_text_presenter.rb', line 18

def credit_application
  return unless r.has_columns?(:reference_number, :id)

  r.reference_number
end

#customerString?

Customer name with account number (no link).

Returns:

  • (String, nil)


8
9
10
11
12
13
# File 'app/presenters/search/credit_application_text_presenter.rb', line 8

def customer
  return unless r.has_columns?(:customer_id)

  cu = Customer.find(r.customer_id)
  "#{cu.full_name} (CN#{r.customer_id})"
end