Class: Decidim::Accountability::AdminLog::ValueTypes::ParentPresenter

Inherits:
Log::ValueTypes::DefaultPresenter
  • Object
show all
Defined in:
app/presenters/decidim/accountability/admin_log/value_types/parent_presenter.rb

Overview

This class presents the given value as a Decidim::Accountability::Result. Check the ‘DefaultPresenter` for more info on how value presenters work.

Instance Method Summary collapse

Instance Method Details

#presentObject

Public: Presents the value as a Decidim::Accountability::Result. If the result can be found, it shows its title. Otherwise it shows its ID.

Returns an HTML-safe String.



14
15
16
17
18
19
# File 'app/presenters/decidim/accountability/admin_log/value_types/parent_presenter.rb', line 14

def present
  return unless value
  return h.translated_attribute(result.title) if result

  I18n.t("not_found", id: value, scope: "decidim.accountability.admin_log.value_types.parent_presenter")
end