Class: Search::CertificationPresenter

Inherits:
BasePresenter
  • Object
show all
Includes:
Presenters::Timeable
Defined in:
app/presenters/search/certification_presenter.rb

Overview

Row presenter for ViewCertification — renders the cells in the CRM
certification search/results table.

Instance Attribute Summary

Attributes inherited from BasePresenter

#current_account, #options, #url_helper

Instance Method Summary collapse

Methods inherited from BasePresenter

#can?, #capture, #concat, #content_tag, #fa_icon, #h, #initialize, #link_to, #number_to_currency, #present, presents, #r, #safe_present, #simple_format, #u

Constructor Details

This class inherits a constructor from BasePresenter

Instance Method Details

Linked certification reference → certification show page; nil when
no certification is recorded.

Returns:

  • (ActiveSupport::SafeBuffer, nil)


42
43
44
# File 'app/presenters/search/certification_presenter.rb', line 42

def certification_link
  h.link_to(r.certification_reference, h.certification_path(r.certification_id)) if r.certification_id.present?
end

Linked course/certification name → course enrollment page.

Returns:

  • (ActiveSupport::SafeBuffer)


34
35
36
# File 'app/presenters/search/certification_presenter.rb', line 34

def course_link
  h.link_to(r.certification_name, h.course_enrollment_path(r.id))
end

Linked customer name → customer show page.

Returns:

  • (ActiveSupport::SafeBuffer)


27
28
29
# File 'app/presenters/search/certification_presenter.rb', line 27

def customer_link
  h.link_to(r.customer_name, h.customer_path(r.customer_id))
end

#is_inactiveString

Human-friendly inactive flag (Yes/No).

Returns:

  • (String)


13
14
15
# File 'app/presenters/search/certification_presenter.rb', line 13

def is_inactive
  h.y r.is_inactive
end

#stateString

Human-readable certification state name.

Returns:

  • (String)


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

def state
  LocatorRecord.human_state_name(r.state)
end