Sha256: 79eb25fe4a72d2458f44996e9e174c0e81670b807a2a9aa440359c0b58017366
Contents?: true
Size: 1.15 KB
Versions: 24
Compression:
Stored size: 1.15 KB
Contents
# frozen_string_literal: true module Decidim module Votings module AdminLog # This class holds the logic to present a `Decidim::Votings::Voting` # 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 # VotingPresenter.new(action_log, view_helpers).present class VotingPresenter < Decidim::Log::BasePresenter private def diff_fields_mapping { title: :i18n, description: :i18n, slug: :string, start_time: :date, end_time: :date, decidim_scope_id: :scope, published_at: :date } end def i18n_labels_scope "activemodel.attributes.voting" end def action_string case action when "create", "publish", "unpublish" "decidim.votings.admin_log.voting.#{action}" else super end end end end end end
Version data entries
24 entries across 24 versions & 1 rubygems