Sha256: 7c85c1b8188ba1bdade10502af9bb4bf05762c723b0af6ebbd7550e23dc516b5
Contents?: true
Size: 1.02 KB
Versions: 13
Compression:
Stored size: 1.02 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:) 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:) respond_to do |format| format.html { render layout: nil } end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems