Sha256: 40035f0f25b6d3ceda31a80eb2dd41900010417a8f44d25a518648f13a56b0f6

Contents?: true

Size: 661 Bytes

Versions: 6

Compression:

Stored size: 661 Bytes

Contents

# frozen-string_literal: true

module Decidim
  module Elections
    module Votes
      class VoteAcceptedEvent < Decidim::Events::SimpleEvent
        # This event sends a notification with the vote hash and further instructions
        i18n_attributes :resource_name, :encrypted_vote_hash, :verify_url

        def resource_name
          @resource_name ||= translated_attribute(resource.title)
        end

        def encrypted_vote_hash
          extra[:vote]["encrypted_vote_hash"]
        end

        def verify_url
          Decidim::EngineRouter.main_proxy(resource.component).verify_election_vote_url(resource)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
decidim-elections-0.24.3 app/events/decidim/elections/votes/vote_accepted_event.rb
decidim-elections-0.24.2 app/events/decidim/elections/votes/vote_accepted_event.rb
decidim-elections-0.24.1 app/events/decidim/elections/votes/vote_accepted_event.rb
decidim-elections-0.24.0 app/events/decidim/elections/votes/vote_accepted_event.rb
decidim-elections-0.24.0.rc2 app/events/decidim/elections/votes/vote_accepted_event.rb
decidim-elections-0.24.0.rc1 app/events/decidim/elections/votes/vote_accepted_event.rb