Class: Search::RmaTextPresenter

Inherits:
RmaPresenter
  • Object
show all
Defined in:
app/presenters/search/rma_text_presenter.rb

Overview

Presenter: rma text presenter.

Instance Method Summary collapse

Instance Method Details



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

def customer_link
  return unless r.has_columns?(:customer_full_name, :customer_id)

  "#{r.customer_full_name} (CN#{r.customer_id})"
end


14
15
16
17
18
# File 'app/presenters/search/rma_text_presenter.rb', line 14

def order_link
  return unless r.has_columns?(:original_order_reference_number, :original_order_id)

  r.original_order_reference_number
end

#returned_reasonsObject



20
21
22
# File 'app/presenters/search/rma_text_presenter.rb', line 20

def returned_reasons
  RmaReasonCode.where(code: r.returned_reasons).order(:code).map { |rrc| "#{rrc.code} - #{rrc.description}" }.join(';')
end


4
5
6
# File 'app/presenters/search/rma_text_presenter.rb', line 4

def rma_link
  r.rma_number
end