Sha256: 5b72d0951463ae955282098b450c2f9852155ebdf27b929717544adb24c9b6e6

Contents?: true

Size: 885 Bytes

Versions: 8

Compression:

Stored size: 885 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Votings
    module Census
      module AdminLog
        # This class holds the logic to present a `Decidim::Votings::Census::Dataset`
        # for the `AdminLog` log.
        #
        # Usage should be automatic and you should not need to call this class
        # directly, but here is an example:
        #
        #    action_log = Decidim::ActionLog.last
        #    view_helpers # => this comes from the views
        #    DatasetPresenter.new(action_log, view_helpers).present
        class DatasetPresenter < Decidim::Log::BasePresenter
          private

          def action_string
            case action
            when "create", "delete", "update"
              "decidim.votings.admin_log.census.#{action}"
            else
              super
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
decidim-elections-0.28.5 app/presenters/decidim/votings/census/admin_log/dataset_presenter.rb
decidim-elections-0.28.4 app/presenters/decidim/votings/census/admin_log/dataset_presenter.rb
decidim-elections-0.28.3 app/presenters/decidim/votings/census/admin_log/dataset_presenter.rb
decidim-elections-0.28.2 app/presenters/decidim/votings/census/admin_log/dataset_presenter.rb
decidim-elections-0.28.1 app/presenters/decidim/votings/census/admin_log/dataset_presenter.rb
decidim-elections-0.28.0 app/presenters/decidim/votings/census/admin_log/dataset_presenter.rb
decidim-elections-0.28.0.rc5 app/presenters/decidim/votings/census/admin_log/dataset_presenter.rb
decidim-elections-0.28.0.rc4 app/presenters/decidim/votings/census/admin_log/dataset_presenter.rb