Sha256: 82b2b3fe7476e33a6c057dfac9979c8f365ed890c6cdf9b8df0aaf9740886779
Contents?: true
Size: 1.02 KB
Versions: 8
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true module Decidim module Elections module AdminLog # This class holds the logic to present a `Decidim::Election` # for the `AdminLog` log. # # Usage should be automatic and you shouldn't need to call this class # directly, but here's an example: # # action_log = Decidim::ActionLog.last # view_helpers # => this comes from the views # ElectionPresenter.new(action_log, view_helpers).present class ElectionPresenter < Decidim::Log::BasePresenter private def diff_fields_mapping { name: :i18n, published_at: :date, weight: :integer } end def i18n_labels_scope "activemodel.attributes.election" end def action_string case action when "publish", "unpublish" "decidim.elections.admin_log.election.#{action}" else super end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems