Sha256: eb9e550cbdf0387c97dec95fe9bfc078564fb4a56f1feb2fa40047b3ba15a9c7
Contents?: true
Size: 1.05 KB
Versions: 46
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true require "active_support/concern" module Decidim module Verifications # Common logic to renew authorizations module Renewable extend ActiveSupport::Concern included do def renew enforce_permission_to :renew, :authorization, authorization: authorization DestroyUserAuthorization.call(authorization) do on(:ok, authorization) do flash[:notice] = t("authorizations.destroy.success", scope: "decidim.verifications") redirect_to new_authorization_path(handler: authorization.name) end on(:invalid) do flash[:alert] = t("authorizations.destroy.error", scope: "decidim.verifications") redirect_to authorizations_path end end end def renew_modal enforce_permission_to :renew, :authorization, authorization: authorization respond_to do |format| format.html { render layout: nil } end end end end end end
Version data entries
46 entries across 46 versions & 1 rubygems