class Decidim::Debates::AdminLog::DebatePresenter
DebatePresenter.new(action_log, view_helpers).present
view_helpers # => this comes from the views
action_log = Decidim::ActionLog.last
directly, but here’s an example:
Usage should be automatic and you shouldn’t need to call this class
for the ‘AdminLog` log.
This class holds the logic to present a `Decidim::Debate`
def action_string
def action_string case action when "create", "update" "decidim.debates.admin_log.debate.#{action}" else super end end
def diff_fields_mapping
def diff_fields_mapping { description: "Decidim::Debates::AdminLog::ValueTypes::DebateTitleDescriptionPresenter", end_date: :date, information_updates: :i18n, instructions: :i18n, start_date: :date, title: "Decidim::Debates::AdminLog::ValueTypes::DebateTitleDescriptionPresenter" } end
def i18n_labels_scope
def i18n_labels_scope "activemodel.attributes.debate" end
def resource_presenter
def resource_presenter @resource_presenter ||= Decidim::Debates::Log::ResourcePresenter.new(action_log.resource, h, action_log.extra["resource"]) end