Sha256: 4b788718258e51ab421757321479444d242cd74df5e2b4b9eac6a2e4ae15f88a
Contents?: true
Size: 772 Bytes
Versions: 25
Compression:
Stored size: 772 Bytes
Contents
# frozen_string_literal: true module Decidim module Log module ValueTypes # This class presents the given value as a # Decidim::ParticipatoryProcessType. If the type can be found, it shows # its title. Otherwise it shows its ID. # # Returns an HTML-safe String class ParticipatoryProcessTypePresenter < Decidim::Log::ValueTypes::DefaultPresenter def present return unless value return h.translated_attribute(type.title) if type I18n.t("not_found", id: value, scope: "decidim.log.value_types.participatory_process_type_presenter") end private def type @type ||= Decidim::ParticipatoryProcessType.find_by(id: value) end end end end end
Version data entries
25 entries across 25 versions & 1 rubygems